aboutsummaryrefslogtreecommitdiffstats
path: root/main/musl
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2014-06-03 10:25:28 +0300
committerTimo Teräs <timo.teras@iki.fi>2014-06-03 10:26:58 +0300
commit72dfeb01ba1e25b20d8c063aef48a8e34c45e162 (patch)
tree0650b8c79028107a233c568f806e74f7e80c960b /main/musl
parent010ee3097b80bbd2fe64f0b420f942cb4507d266 (diff)
downloadaports-72dfeb01ba1e25b20d8c063aef48a8e34c45e162.tar.bz2
aports-72dfeb01ba1e25b20d8c063aef48a8e34c45e162.tar.xz
main/musl: upgrade to git snapshot of 2014-06-03
Diffstat (limited to 'main/musl')
-rw-r--r--main/musl/0002-76f440cf-to-d85d261e.patch89
-rw-r--r--main/musl/APKBUILD6
2 files changed, 94 insertions, 1 deletions
diff --git a/main/musl/0002-76f440cf-to-d85d261e.patch b/main/musl/0002-76f440cf-to-d85d261e.patch
new file mode 100644
index 0000000000..67e2e46ed5
--- /dev/null
+++ b/main/musl/0002-76f440cf-to-d85d261e.patch
@@ -0,0 +1,89 @@
+diff --git a/src/multibyte/wcsrtombs.c b/src/multibyte/wcsrtombs.c
+index 5cf8f3e..30be415 100644
+--- a/src/multibyte/wcsrtombs.c
++++ b/src/multibyte/wcsrtombs.c
+@@ -21,8 +21,13 @@ size_t wcsrtombs(char *restrict s, const wchar_t **restrict ws, size_t n, mbstat
+ }
+ return n;
+ }
+- while (n>=4 && **ws) {
+- if (**ws >= 0x80u) {
++ while (n>=4) {
++ if (**ws-1u >= 0x7fu) {
++ if (!**ws) {
++ *s = 0;
++ *ws = 0;
++ return N-n;
++ }
+ l = wcrtomb(s, **ws, 0);
+ if (!(l+1)) return -1;
+ s += l;
+@@ -33,8 +38,13 @@ size_t wcsrtombs(char *restrict s, const wchar_t **restrict ws, size_t n, mbstat
+ }
+ (*ws)++;
+ }
+- while (n && **ws) {
+- if (**ws >= 0x80u) {
++ while (n) {
++ if (**ws-1u >= 0x7fu) {
++ if (!**ws) {
++ *s = 0;
++ *ws = 0;
++ return N-n;
++ }
+ l = wcrtomb(buf, **ws, 0);
+ if (!(l+1)) return -1;
+ if (l>n) return N-n;
+@@ -47,7 +57,5 @@ size_t wcsrtombs(char *restrict s, const wchar_t **restrict ws, size_t n, mbstat
+ }
+ (*ws)++;
+ }
+- if (n) *s = 0;
+- *ws = 0;
+- return N-n;
++ return N;
+ }
+diff --git a/src/network/dns_parse.c b/src/network/dns_parse.c
+index aa0d39f..0c7a601 100644
+--- a/src/network/dns_parse.c
++++ b/src/network/dns_parse.c
+@@ -6,6 +6,7 @@ int __dns_parse(const unsigned char *r, int rlen, int (*callback)(void *, int, c
+ const unsigned char *p;
+ int len;
+
++ if (rlen<12) return -1;
+ if ((r[3]&15)) return 0;
+ p = r+12;
+ qdcount = r[4]*256 + r[5];
+@@ -13,13 +14,13 @@ int __dns_parse(const unsigned char *r, int rlen, int (*callback)(void *, int, c
+ if (qdcount+ancount > 64) return -1;
+ while (qdcount--) {
+ while (p-r < rlen && *p-1U < 127) p++;
+- if (*p>193 || (*p==193 && p[1]>254) || p>r+506)
++ if (*p>193 || (*p==193 && p[1]>254) || p>r+rlen-6)
+ return -1;
+ p += 5 + !!*p;
+ }
+ while (ancount--) {
+ while (p-r < rlen && *p-1U < 127) p++;
+- if (*p>193 || (*p==193 && p[1]>254) || p>r+506)
++ if (*p>193 || (*p==193 && p[1]>254) || p>r+rlen-6)
+ return -1;
+ p += 1 + !!*p;
+ len = p[8]*256 + p[9];
+diff --git a/src/network/lookup_name.c b/src/network/lookup_name.c
+index 8d41627..0292093 100644
+--- a/src/network/lookup_name.c
++++ b/src/network/lookup_name.c
+@@ -151,7 +151,10 @@ static int name_from_dns(struct address buf[static MAXADDRS], char canon[static
+ for (i=0; i<nq; i++)
+ __dns_parse(abuf[i], alens[i], dns_parse_callback, &ctx);
+
+- return ctx.cnt;
++ if (ctx.cnt) return ctx.cnt;
++ if (alens[0] < 4 || (abuf[0][3] & 15) == 2) return EAI_AGAIN;
++ if ((abuf[0][3] & 15) == 3) return EAI_NONAME;
++ return EAI_FAIL;
+ }
+
+ int __lookup_name(struct address buf[static MAXADDRS], char canon[static 256], const char *name, int family, int flags)
diff --git a/main/musl/APKBUILD b/main/musl/APKBUILD
index f44f100d7c..12a2f43857 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.1
-pkgrel=1
+pkgrel=2
pkgdesc="the musl c library (libc) implementation"
url="http://www.musl-libc.org/"
arch="all"
@@ -14,6 +14,7 @@ install=""
subpackages="$pkgname-dev $pkgname-utils"
source="http://www.musl-libc.org/releases/musl-$pkgver.tar.gz
0001-v1.1.1-to-76f440cf.patch
+ 0002-76f440cf-to-d85d261e.patch
1001-add-basic-dns-record-parsing-functions.patch
1002-reimplement-if_nameindex-and-getifaddrs-using-netlin.patch
1003-implement-y-and-C-specifiers-in-strptime.patch
@@ -120,6 +121,7 @@ utils() {
md5sums="dbc08d311148e095016d9bbf6c7ffda6 musl-1.1.1.tar.gz
d4a40fe1656115b2956065ab48e0b372 0001-v1.1.1-to-76f440cf.patch
+0b0dce47217fe25eeb82a7f70e15629f 0002-76f440cf-to-d85d261e.patch
a3810683ef61ac27e2f6ec9801280c81 1001-add-basic-dns-record-parsing-functions.patch
83c3bd2a50b1de5ef948704d3f4e0583 1002-reimplement-if_nameindex-and-getifaddrs-using-netlin.patch
fc3feec4104a4b25781df92dd96b9eec 1003-implement-y-and-C-specifiers-in-strptime.patch
@@ -132,6 +134,7 @@ cb82d21fed17a116b44b830adba71c5a getconf.c
45f92f8d59cf84d765de698a9578dbf4 iconv.c"
sha256sums="9dd75d6512e44d5a13254e246db56c90365894b05bab2b1127e44a31e4fd7c36 musl-1.1.1.tar.gz
40f241a8aa59621d8a9e6a616df27c38e0a622243bf7346cc98ec1c37454e92a 0001-v1.1.1-to-76f440cf.patch
+d0f4dbc8f0e72df02fcb12e75f829d50909c6da222a5f6a13a0e0c991f91d56e 0002-76f440cf-to-d85d261e.patch
758390768b1bc4159d56908ca332b9640cd0552ed3b4b2b8d4a6d499c54c11a1 1001-add-basic-dns-record-parsing-functions.patch
1c25880095e869b827f02997e864fdf4bf157a4e923e52d97dbd05e657aedb70 1002-reimplement-if_nameindex-and-getifaddrs-using-netlin.patch
c22338bc33e8c0c22b280c392b37a0903e13562e671f5ebade09ed5b1d33e2ae 1003-implement-y-and-C-specifiers-in-strptime.patch
@@ -144,6 +147,7 @@ d9b644ec20bc33e81a7c52b9fcf7973d835923a69faf50f03db45534b811bd96 getopt_long.c
f79a2930a2e5bb0624321589edf8b889d1e9b603e01e6b7ae214616605b3fdd7 iconv.c"
sha512sums="5182deb80a35c8a4009d71098c95a16e5ab9bd03186443917652f0c521d2980183e203256493a69e8230b6a0c4848ca8e44de9e8c851a511cd37d0d41f91b14f musl-1.1.1.tar.gz
30906a5f7a01ff05693e5a2e72f6c7e75ff7939c28a32b9e777d14d59412bb9df603a09aa8dd693e9a0b70525474a62f7bc657425032a3a5f4b339667e6f62ec 0001-v1.1.1-to-76f440cf.patch
+358f3828367f5a86806ce5be5842c2be44c1a7919133ab83a7c549bc55be847fee2a938c201782db771ff6a5a994cab6ee7c2050f6ae564f4993c0b3825faa36 0002-76f440cf-to-d85d261e.patch
dad965258daf69371b844f76bfe5a914b0eca0ca76f3fc340b8fd7acf598b5f87bbe6d68b1f43ed0293ee0ed3bfd85d5173ccc169aa6265646248d5b8a906708 1001-add-basic-dns-record-parsing-functions.patch
72cf33738d2cf31f6ec02312bc494d754c17470b519172bb8bd7e2e29ac3b119023088a2b3fbc0dbc2fddd0078ccbae62096106cae361f8c31d6a9950043af25 1002-reimplement-if_nameindex-and-getifaddrs-using-netlin.patch
48082d2348de40bc6b455266c5552a62e1e75f926e69116c61c8a3cb35fefdff136dc771bf25ee7d43c959834921221112ed7afcc45fcadbcf07562510786916 1003-implement-y-and-C-specifiers-in-strptime.patch