diff options
author | Leo <thinkabit.ukim@gmail.com> | 2019-10-11 16:32:12 -0300 |
---|---|---|
committer | Kevin Daudt <kdaudt@alpinelinux.org> | 2019-10-20 15:32:44 +0000 |
commit | 0aa5cea84fa7029c83cff7e6fab3046d80aa65e0 (patch) | |
tree | 4273bbc251d8b7f9bbe204565576d2b7f9a362af | |
parent | 46474408740714e611f9cfa21f0f80d3773e4d9c (diff) | |
download | aports-0aa5cea84fa7029c83cff7e6fab3046d80aa65e0.tar.bz2 aports-0aa5cea84fa7029c83cff7e6fab3046d80aa65e0.tar.xz |
main/sqlite: fix CVE-2019-16168
ref #10868
Closes !420
-rw-r--r-- | main/sqlite/APKBUILD | 12 | ||||
-rw-r--r-- | main/sqlite/CVE-2019-16168.patch | 24 |
2 files changed, 32 insertions, 4 deletions
diff --git a/main/sqlite/APKBUILD b/main/sqlite/APKBUILD index eefedb370d..36d27d5dd3 100644 --- a/main/sqlite/APKBUILD +++ b/main/sqlite/APKBUILD @@ -2,7 +2,7 @@ # Contributor: Ćukasz Jendrysik <scadu@yandex.com> pkgname=sqlite pkgver=3.25.3 -pkgrel=1 +pkgrel=2 pkgdesc="C library that implements an SQL database engine" url="http://www.sqlite.org" arch="all" @@ -32,6 +32,7 @@ builddir="$srcdir/$pkgname-autoconf-$_ver" source="http://www.sqlite.org/2018/$pkgname-autoconf-$_ver.tar.gz license.txt CVE-2019-8457.patch + CVE-2019-16168.patch " # additional CFLAGS to set @@ -48,10 +49,12 @@ _amalgamation="-DSQLITE_ENABLE_FTS4 \ -DSQLITE_ENABLE_JSON1" # secfixes: +# 3.25.3-r2: +# - CVE-2018-20346 # 3.25.3-r1: -# - CVE-2019-8457 +# - CVE-2019-8457 # 3.25.3-r0: -# - CVE-2018-20346 +# - CVE-2018-20346 build() { cd "$builddir" @@ -94,4 +97,5 @@ libs() { sha512sums="5bc501d15367e097f4070185974b0c3a8246c06b205fb2258ed18870ff3fbf120ac5e0ba031a6744af89f7659206e28e7de2f0367bdb190b8412e453b43de4ba sqlite-autoconf-3250300.tar.gz 5bde14bec5bf18cc686b8b90a8b2324c8c6600bca1ae56431a795bb34b8b5ae85527143f3b5f0c845c776bce60eaa537624104cefc3a47b3820d43083f40c6e9 license.txt -ab795b18d5426ff9ccad20f413de4f46fce7b532ebbf72dfbafc7db2d2e46453541abe992535c7aea598ec69c8557b477008e58299e3426afd2e8ab458c859e4 CVE-2019-8457.patch" +ab795b18d5426ff9ccad20f413de4f46fce7b532ebbf72dfbafc7db2d2e46453541abe992535c7aea598ec69c8557b477008e58299e3426afd2e8ab458c859e4 CVE-2019-8457.patch +19eb036e0d03543127a9ed67155522952cb7f3ce9da81ee49fba14a1c0bfc2cd0c86acab1b47b794043cac033959d861dce7ec97fca2293cb146a7ee1b83b8fa CVE-2019-16168.patch" diff --git a/main/sqlite/CVE-2019-16168.patch b/main/sqlite/CVE-2019-16168.patch new file mode 100644 index 0000000000..d1be258aec --- /dev/null +++ b/main/sqlite/CVE-2019-16168.patch @@ -0,0 +1,24 @@ +diff --git a/sqlite3.c b/sqlite3.c +index c607252..7c01bbf 100644 +--- a/sqlite3.c ++++ b/sqlite3.c +@@ -104242,7 +104242,9 @@ static void decodeIntArray( + if( sqlite3_strglob("unordered*", z)==0 ){ + pIndex->bUnordered = 1; + }else if( sqlite3_strglob("sz=[0-9]*", z)==0 ){ +- pIndex->szIdxRow = sqlite3LogEst(sqlite3Atoi(z+3)); ++ int sz = sqlite3Atoi(z+3); ++ if( sz<2 ) sz = 2; ++ pIndex->szIdxRow = sqlite3LogEst(sz); + }else if( sqlite3_strglob("noskipscan*", z)==0 ){ + pIndex->noSkipScan = 1; + } +@@ -141020,6 +141022,7 @@ static int whereLoopAddBtreeIndex( + ** it to pNew->rRun, which is currently set to the cost of the index + ** seek only. Then, if this is a non-covering index, add the cost of + ** visiting the rows in the main table. */ ++ assert( pSrc->pTab->szTabRow>0 ); + rCostIdx = pNew->nOut + 1 + (15*pProbe->szIdxRow)/pSrc->pTab->szTabRow; + pNew->rRun = sqlite3LogEstAdd(rLogSize, rCostIdx); + if( (pNew->wsFlags & (WHERE_IDX_ONLY|WHERE_IPK))==0 ){ + |