aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo <thinkabit.ukim@gmail.com>2019-10-11 12:46:35 -0300
committerNatanael Copa <ncopa@alpinelinux.org>2019-10-11 20:54:30 +0200
commit18528a54c8a02fb5f59a2e8fb70ec0b83486acc6 (patch)
tree5463ef9a00643fc5a5fc5789e8209a3ad86caeb1
parenta2917cd333abcae68d58f0ee3967b24657547dc2 (diff)
downloadaports-18528a54c8a02fb5f59a2e8fb70ec0b83486acc6.tar.bz2
aports-18528a54c8a02fb5f59a2e8fb70ec0b83486acc6.tar.xz
main/sqlite: fix CVE-2019-16168
ref #10868
-rw-r--r--main/sqlite/APKBUILD11
-rw-r--r--main/sqlite/CVE-2019-16168.patch24
2 files changed, 32 insertions, 3 deletions
diff --git a/main/sqlite/APKBUILD b/main/sqlite/APKBUILD
index 6b01229662..6199bec024 100644
--- a/main/sqlite/APKBUILD
+++ b/main/sqlite/APKBUILD
@@ -2,7 +2,7 @@
# Contributor: Ɓukasz Jendrysik <scadu@yandex.com>
pkgname=sqlite
pkgver=3.28.0
-pkgrel=0
+pkgrel=1
pkgdesc="C library that implements an SQL database engine"
url="https://www.sqlite.org/"
arch="all"
@@ -30,9 +30,13 @@ _ver=${_a}${_b}${_c}${_d}
# these variables depend on _ver being set
builddir="$srcdir/$pkgname-autoconf-$_ver"
source="https://www.sqlite.org/2019/$pkgname-autoconf-$_ver.tar.gz
- license.txt"
+ license.txt
+ CVE-2019-16168.patch
+ "
# secfixes:
+# 3.28.0-r1:
+# - CVE-2019-16168
# 3.28.0-r0:
# - CVE-2019-5018
# - CVE-2019-8457
@@ -104,4 +108,5 @@ static() {
}
sha512sums="e800c0d9e6c8c01ccf1d714c6c4da4b98e9610c4c06557dda6393d0792a8ae09788703d4a74dcb21844c49b3629ff7ed95a4a86ff79872aafd2b49c672c7a570 sqlite-autoconf-3280000.tar.gz
-5bde14bec5bf18cc686b8b90a8b2324c8c6600bca1ae56431a795bb34b8b5ae85527143f3b5f0c845c776bce60eaa537624104cefc3a47b3820d43083f40c6e9 license.txt"
+5bde14bec5bf18cc686b8b90a8b2324c8c6600bca1ae56431a795bb34b8b5ae85527143f3b5f0c845c776bce60eaa537624104cefc3a47b3820d43083f40c6e9 license.txt
+db937bc87068b486e5163a5493acba2d7b89aa6b45d55cbc1c8b53e6889c53e6be060997f340dfad44c3df328c7891b49277f56299a9531248381a214fb4079d 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..e336b4aaee
--- /dev/null
+++ b/main/sqlite/CVE-2019-16168.patch
@@ -0,0 +1,24 @@
+diff --git a/sqlite3.c b/sqlite3.c
+index 4404295..b40ca97 100644
+--- a/sqlite3.c
++++ b/sqlite3.c
+@@ -105489,7 +105489,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;
+ }
+@@ -142704,6 +142706,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 ){
+