aboutsummaryrefslogtreecommitdiffstats
path: root/main/musl
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2016-04-01 18:01:02 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2016-04-01 18:01:40 +0000
commit4ad5f408b8cc7952c83ce677aad0143657deed6f (patch)
treef74893a74eca2622fbc64471ad0404d5ae73085f /main/musl
parentad2cf2221a8835fedb7a1c1060b16f1f9f6429ea (diff)
downloadaports-4ad5f408b8cc7952c83ce677aad0143657deed6f.tar.bz2
aports-4ad5f408b8cc7952c83ce677aad0143657deed6f.tar.xz
main/musl: add upstream fix for memmem
Diffstat (limited to 'main/musl')
-rw-r--r--main/musl/APKBUILD6
-rw-r--r--main/musl/memmem.patch35
2 files changed, 40 insertions, 1 deletions
diff --git a/main/musl/APKBUILD b/main/musl/APKBUILD
index 3d574b43ce..6f473d139f 100644
--- a/main/musl/APKBUILD
+++ b/main/musl/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Timo Teräs <timo.teras@iki.fi>
pkgname=musl
pkgver=1.1.14
-pkgrel=6
+pkgrel=7
pkgdesc="the musl c library (libc) implementation"
url="http://www.musl-libc.org/"
arch="all"
@@ -21,6 +21,7 @@ source="http://www.musl-libc.org/releases/musl-$pkgver.tar.gz
0007-fix-gethostbyaddr_r-to-fill-struct-hostent.h_length-.patch
0008-fix-undefined-pointer-comparison-in-stdio-internal-_.patch
0009-fix-regression-disabling-use-of-pause-instruction-fo.patch
+ memmem.patch
ldconfig
__stack_chk_fail_local.c
@@ -137,6 +138,7 @@ d85fdb4d80c8372d8e63cf4382e4012a 0006-fix-padding-string-formats-to-width-in-wi
882309436377613d8b65a1fed573f125 0007-fix-gethostbyaddr_r-to-fill-struct-hostent.h_length-.patch
4701e50c55b520e644c9e9a94e851d7f 0008-fix-undefined-pointer-comparison-in-stdio-internal-_.patch
a2457ce90f3e4d5ef04005b6f42e9bc3 0009-fix-regression-disabling-use-of-pause-instruction-fo.patch
+3d5b6f9614083cff7b845deeb5e4c13d memmem.patch
830d01f7821b978df770b06db3790921 ldconfig
0df687757221bbb0fc1aa67f1bd646f9 __stack_chk_fail_local.c
57ef2c63b9ec6a2041694ace97d4ffa2 getconf.c
@@ -152,6 +154,7 @@ e4e36277864e1445295be1397c930c649905ddfa32f1ed65c6defb67f78dd0e8 0004-math-fix-
7cec62c7a4ee9d1fa5cd79391aabe9363006ccc6c942fd09924b038e7224f144 0007-fix-gethostbyaddr_r-to-fill-struct-hostent.h_length-.patch
b937311664b96b6272e4e62e1aa0d44edd58c825cbb95746c82fab85a6390968 0008-fix-undefined-pointer-comparison-in-stdio-internal-_.patch
4eefc6e8e95da425a519e093e6f9e15390d498070759256de4d86a89679236b9 0009-fix-regression-disabling-use-of-pause-instruction-fo.patch
+5f0d4174d8ad8db95211581d778d8ad696ad85b06abc0b2e1ae39461930217ee memmem.patch
b4a2c06db38742e8c42c3c9838b285a7d8cdac6c091ff3df5ff9a15f1e41b9c7 ldconfig
299a7d75a09de3e2e11e7fb4acc3182e4a14e868093d2f30938fce9bfcff13da __stack_chk_fail_local.c
d87d0cbb3690ae2c5d8cc218349fd8278b93855dd625deaf7ae50e320aad247c getconf.c
@@ -167,6 +170,7 @@ fb30c3d1113e3cdaf575b37257b1184f2d5cc7cea0eb0ee94a71e861f9c72fe924de5f6382670158
ffb52c8a24bfa5fcad0561c6c4f6f265b0b3666f0c6e8c0a12b1f11c9aeb1c51b17f4f0fccdd70a3e94dccb17650efaf24635cd12b64d12c09469ca1399d99d7 0007-fix-gethostbyaddr_r-to-fill-struct-hostent.h_length-.patch
afa17d63f3de02661709d3712d1586b3173518476d314ca2b1e72a3814536538c81aefa5a4ec0cee3470af7177dd4842ab6e62e891ae85a88102bb703ba09c59 0008-fix-undefined-pointer-comparison-in-stdio-internal-_.patch
5818f2563a7a335aec2cbaaeb4acb80d1380206dd03110331adb09fd1279c84f09883e2f92e0d8964079acf3d4fc173c1b5073091c874c492f2f5a966e1cccb7 0009-fix-regression-disabling-use-of-pause-instruction-fo.patch
+fe5b9990ede91e205b040f23a24043472faae47390591dfbd8dfd29f02498b8642a6a919f00e7425ed86f765c7b29e2ccbb8560b6e2de1d35e5ef687ac26eda6 memmem.patch
8d3a2d5315fc56fee7da9abb8b89bb38c6046c33d154c10d168fb35bfde6b0cf9f13042a3bceee34daf091bc409d699223735dcf19f382eeee1f6be34154f26f ldconfig
062bb49fa54839010acd4af113e20f7263dde1c8a2ca359b5fb2661ef9ed9d84a0f7c3bc10c25dcfa10bb3c5a4874588dff636ac43d5dbb3d748d75400756d0b __stack_chk_fail_local.c
0d80f37b34a35e3d14b012257c50862dfeb9d2c81139ea2dfa101d981d093b009b9fa450ba27a708ac59377a48626971dfc58e20a3799084a65777a0c32cbc7d getconf.c
diff --git a/main/musl/memmem.patch b/main/musl/memmem.patch
new file mode 100644
index 0000000000..9753dabbb7
--- /dev/null
+++ b/main/musl/memmem.patch
@@ -0,0 +1,35 @@
+From c718f9fc1b4bd913eff10d0c12763f90b2bc487c Mon Sep 17 00:00:00 2001
+From: Rich Felker <dalias@aerifal.cx>
+Date: Fri, 1 Apr 2016 13:36:15 -0400
+Subject: fix read past end of haystack buffer for short needles in memmem
+
+the two/three/four byte memmem specializations are not prepared to
+handle haystacks shorter than the needle; they unconditionally read at
+least up to the needle length and subtract from the haystack length.
+if the haystack is shorter, the remaining haystack length underflows
+and produces an unbounded search which will eventually either crash or
+find a spurious match.
+
+the top-level memmem function attempted to avoid this case already by
+checking for haystack shorter than needle, but it failed to re-check
+after using memchr to remove the maximal prefix not containing the
+first byte of the needle.
+---
+ src/string/memmem.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/string/memmem.c b/src/string/memmem.c
+index d7e1221..4be6a31 100644
+--- a/src/string/memmem.c
++++ b/src/string/memmem.c
+@@ -140,6 +140,7 @@ void *memmem(const void *h0, size_t k, const void *n0, size_t l)
+ h = memchr(h0, *n, k);
+ if (!h || l==1) return (void *)h;
+ k -= h - (const unsigned char *)h0;
++ if (k<l) return 0;
+ if (l==2) return twobyte_memmem(h, k, n);
+ if (l==3) return threebyte_memmem(h, k, n);
+ if (l==4) return fourbyte_memmem(h, k, n);
+--
+cgit v0.11.2
+