Commit aa2bbd1d authored by Timo Teräs's avatar Timo Teräs

main/musl: upstream fix and gethostbyaddr_r fix

fixes #5282
parent bdd2fcce
From 4aac019a0efd59011a48d031ad046c934c7e8365 Mon Sep 17 00:00:00 2001
From: Rich Felker <dalias@aerifal.cx>
Date: Wed, 16 Mar 2016 16:35:22 -0400
Subject: [PATCH] fix padding string formats to width in wide printf variants
the idiom fprintf(f, "%.*s", n, "") was wrongly used in vfwprintf as a
means of producing n spaces; instead it produces no output. the
correct form is fprintf(f, "%*s", n, ""), using width instead of
precision, since for %s the later is a maximum rather than a minimum.
---
src/stdio/vfwprintf.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/stdio/vfwprintf.c b/src/stdio/vfwprintf.c
index f06d5ae..f9f1ecf 100644
--- a/src/stdio/vfwprintf.c
+++ b/src/stdio/vfwprintf.c
@@ -288,9 +288,9 @@ static int wprintf_core(FILE *f, const wchar_t *fmt, va_list *ap, union arg *nl_
z = wmemchr(a, 0, p);
if (z) p=z-a;
if (w<p) w=p;
- if (!(fl&LEFT_ADJ)) fprintf(f, "%.*s", w-p, "");
+ if (!(fl&LEFT_ADJ)) fprintf(f, "%*s", w-p, "");
out(f, a, p);
- if ((fl&LEFT_ADJ)) fprintf(f, "%.*s", w-p, "");
+ if ((fl&LEFT_ADJ)) fprintf(f, "%*s", w-p, "");
l=w;
continue;
case 'm':
@@ -303,14 +303,14 @@ static int wprintf_core(FILE *f, const wchar_t *fmt, va_list *ap, union arg *nl_
if (i<0) return -1;
p=l;
if (w<p) w=p;
- if (!(fl&LEFT_ADJ)) fprintf(f, "%.*s", w-p, "");
+ if (!(fl&LEFT_ADJ)) fprintf(f, "%*s", w-p, "");
bs = arg.p;
while (l--) {
i=mbtowc(&wc, bs, MB_LEN_MAX);
bs+=i;
fputwc(wc, f);
}
- if ((fl&LEFT_ADJ)) fprintf(f, "%.*s", w-p, "");
+ if ((fl&LEFT_ADJ)) fprintf(f, "%*s", w-p, "");
l=w;
continue;
}
--
2.7.4
From d378d05848f745598216259b6dba7c70f0e90300 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Tue, 22 Mar 2016 16:27:51 +0200
Subject: [PATCH] fix gethostbyaddr_r to fill struct hostent.h_length as
appropriate
---
src/network/gethostbyaddr_r.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/network/gethostbyaddr_r.c b/src/network/gethostbyaddr_r.c
index 66e0330..0f1e61a 100644
--- a/src/network/gethostbyaddr_r.c
+++ b/src/network/gethostbyaddr_r.c
@@ -64,6 +64,7 @@ int gethostbyaddr_r(const void *a, socklen_t l, int af,
}
h->h_addrtype = af;
+ h->h_length = l;
h->h_name = h->h_aliases[0];
*res = h;
return 0;
--
2.7.4
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Maintainer: Timo Teräs <timo.teras@iki.fi> # Maintainer: Timo Teräs <timo.teras@iki.fi>
pkgname=musl pkgname=musl
pkgver=1.1.14 pkgver=1.1.14
pkgrel=4 pkgrel=5
pkgdesc="the musl c library (libc) implementation" pkgdesc="the musl c library (libc) implementation"
url="http://www.musl-libc.org/" url="http://www.musl-libc.org/"
arch="all" arch="all"
...@@ -17,6 +17,8 @@ source="http://www.musl-libc.org/releases/musl-$pkgver.tar.gz ...@@ -17,6 +17,8 @@ source="http://www.musl-libc.org/releases/musl-$pkgver.tar.gz
0003-fix-at-the-start-of-a-complete-BRE.patch 0003-fix-at-the-start-of-a-complete-BRE.patch
0004-math-fix-expf-NAN-and-exp2f-NAN-to-return-NAN-instea.patch 0004-math-fix-expf-NAN-and-exp2f-NAN-to-return-NAN-instea.patch
0005-env-avoid-leaving-dangling-pointers-in-__env_map.patch 0005-env-avoid-leaving-dangling-pointers-in-__env_map.patch
0006-fix-padding-string-formats-to-width-in-wide-printf-v.patch
1001-fix-gethostbyaddr_r-to-fill-struct-hostent.h_length-.patch
ldconfig ldconfig
__stack_chk_fail_local.c __stack_chk_fail_local.c
...@@ -129,6 +131,8 @@ c683094384c5726a99d1047f01aeb331 0001-handle-non-matching-address-family-entrie ...@@ -129,6 +131,8 @@ c683094384c5726a99d1047f01aeb331 0001-handle-non-matching-address-family-entrie
6cee220f293754cd1e7126f3d4db5b43 0003-fix-at-the-start-of-a-complete-BRE.patch 6cee220f293754cd1e7126f3d4db5b43 0003-fix-at-the-start-of-a-complete-BRE.patch
476dc9157a7ac6de5bb6f7c5a5ef7a2d 0004-math-fix-expf-NAN-and-exp2f-NAN-to-return-NAN-instea.patch 476dc9157a7ac6de5bb6f7c5a5ef7a2d 0004-math-fix-expf-NAN-and-exp2f-NAN-to-return-NAN-instea.patch
a372031134c17cefb9aad3c9c0e6bb19 0005-env-avoid-leaving-dangling-pointers-in-__env_map.patch a372031134c17cefb9aad3c9c0e6bb19 0005-env-avoid-leaving-dangling-pointers-in-__env_map.patch
d85fdb4d80c8372d8e63cf4382e4012a 0006-fix-padding-string-formats-to-width-in-wide-printf-v.patch
366e32f17cbe18b4d4855eda6b4f82cb 1001-fix-gethostbyaddr_r-to-fill-struct-hostent.h_length-.patch
830d01f7821b978df770b06db3790921 ldconfig 830d01f7821b978df770b06db3790921 ldconfig
0df687757221bbb0fc1aa67f1bd646f9 __stack_chk_fail_local.c 0df687757221bbb0fc1aa67f1bd646f9 __stack_chk_fail_local.c
57ef2c63b9ec6a2041694ace97d4ffa2 getconf.c 57ef2c63b9ec6a2041694ace97d4ffa2 getconf.c
...@@ -140,6 +144,8 @@ sha256sums="35f6c00c84a6091bd5dab29eedde7508dae755ead92dcc0239f3677d1055b9b5 mu ...@@ -140,6 +144,8 @@ sha256sums="35f6c00c84a6091bd5dab29eedde7508dae755ead92dcc0239f3677d1055b9b5 mu
13d285aba7e5e33dca32e6adbb5ada69f0f88f0320968b201d03fe02f1a70d4c 0003-fix-at-the-start-of-a-complete-BRE.patch 13d285aba7e5e33dca32e6adbb5ada69f0f88f0320968b201d03fe02f1a70d4c 0003-fix-at-the-start-of-a-complete-BRE.patch
e4e36277864e1445295be1397c930c649905ddfa32f1ed65c6defb67f78dd0e8 0004-math-fix-expf-NAN-and-exp2f-NAN-to-return-NAN-instea.patch e4e36277864e1445295be1397c930c649905ddfa32f1ed65c6defb67f78dd0e8 0004-math-fix-expf-NAN-and-exp2f-NAN-to-return-NAN-instea.patch
02cd2b0c92ab04a7e39ab4bf53687bc3354b8fffe3cb4aba9cb630532ce43d4a 0005-env-avoid-leaving-dangling-pointers-in-__env_map.patch 02cd2b0c92ab04a7e39ab4bf53687bc3354b8fffe3cb4aba9cb630532ce43d4a 0005-env-avoid-leaving-dangling-pointers-in-__env_map.patch
6037fa5aee8dba3d3b01ded5752d876954c23da3a53ed5a734f0816a2ef1d4bd 0006-fix-padding-string-formats-to-width-in-wide-printf-v.patch
4b54d17049582fa11b9e28406412ec0538af70476f9e2331e083e6ae37d938b9 1001-fix-gethostbyaddr_r-to-fill-struct-hostent.h_length-.patch
b4a2c06db38742e8c42c3c9838b285a7d8cdac6c091ff3df5ff9a15f1e41b9c7 ldconfig b4a2c06db38742e8c42c3c9838b285a7d8cdac6c091ff3df5ff9a15f1e41b9c7 ldconfig
299a7d75a09de3e2e11e7fb4acc3182e4a14e868093d2f30938fce9bfcff13da __stack_chk_fail_local.c 299a7d75a09de3e2e11e7fb4acc3182e4a14e868093d2f30938fce9bfcff13da __stack_chk_fail_local.c
d87d0cbb3690ae2c5d8cc218349fd8278b93855dd625deaf7ae50e320aad247c getconf.c d87d0cbb3690ae2c5d8cc218349fd8278b93855dd625deaf7ae50e320aad247c getconf.c
...@@ -151,6 +157,8 @@ sha512sums="9016246b44a7e6ef51477f0a246373c79f3e796c70031c3323be1b6c4c0518a2d457 ...@@ -151,6 +157,8 @@ sha512sums="9016246b44a7e6ef51477f0a246373c79f3e796c70031c3323be1b6c4c0518a2d457
51a16e88f602d1db175d82d8276273006b74dc7e87340207e26db80820bab368c50f4d1539175bf3b5b3b23ae6da2e452e81f858029bfef49c54f548bc1a4674 0003-fix-at-the-start-of-a-complete-BRE.patch 51a16e88f602d1db175d82d8276273006b74dc7e87340207e26db80820bab368c50f4d1539175bf3b5b3b23ae6da2e452e81f858029bfef49c54f548bc1a4674 0003-fix-at-the-start-of-a-complete-BRE.patch
bae8e0f4a1f73be42450945058c1106957da56dc7fa087515dd51bcac3c7099c4cfe4e8c44fb8efc059944d0675858b747396d60c884b031663983912262e992 0004-math-fix-expf-NAN-and-exp2f-NAN-to-return-NAN-instea.patch bae8e0f4a1f73be42450945058c1106957da56dc7fa087515dd51bcac3c7099c4cfe4e8c44fb8efc059944d0675858b747396d60c884b031663983912262e992 0004-math-fix-expf-NAN-and-exp2f-NAN-to-return-NAN-instea.patch
202f21518ca75373712430fb547662e7a4936c6947cb61fe97fd5dbd9f48217ca38f90439d51b03cafce9a2bfd90e360182a454f3b941abae033d90f2bffe50c 0005-env-avoid-leaving-dangling-pointers-in-__env_map.patch 202f21518ca75373712430fb547662e7a4936c6947cb61fe97fd5dbd9f48217ca38f90439d51b03cafce9a2bfd90e360182a454f3b941abae033d90f2bffe50c 0005-env-avoid-leaving-dangling-pointers-in-__env_map.patch
fb30c3d1113e3cdaf575b37257b1184f2d5cc7cea0eb0ee94a71e861f9c72fe924de5f63826701584f68c9e1c9c4c1357a967ebe00f637312193e268f7a7cf94 0006-fix-padding-string-formats-to-width-in-wide-printf-v.patch
e3e0ebc19362e93ed1a278688e3acc082c23993daf0eb14ba011917ad076b2348bbe3fc9a939011884223f2dada3280b63fb7e7cb50373bebff0cf857899acaa 1001-fix-gethostbyaddr_r-to-fill-struct-hostent.h_length-.patch
8d3a2d5315fc56fee7da9abb8b89bb38c6046c33d154c10d168fb35bfde6b0cf9f13042a3bceee34daf091bc409d699223735dcf19f382eeee1f6be34154f26f ldconfig 8d3a2d5315fc56fee7da9abb8b89bb38c6046c33d154c10d168fb35bfde6b0cf9f13042a3bceee34daf091bc409d699223735dcf19f382eeee1f6be34154f26f ldconfig
062bb49fa54839010acd4af113e20f7263dde1c8a2ca359b5fb2661ef9ed9d84a0f7c3bc10c25dcfa10bb3c5a4874588dff636ac43d5dbb3d748d75400756d0b __stack_chk_fail_local.c 062bb49fa54839010acd4af113e20f7263dde1c8a2ca359b5fb2661ef9ed9d84a0f7c3bc10c25dcfa10bb3c5a4874588dff636ac43d5dbb3d748d75400756d0b __stack_chk_fail_local.c
0d80f37b34a35e3d14b012257c50862dfeb9d2c81139ea2dfa101d981d093b009b9fa450ba27a708ac59377a48626971dfc58e20a3799084a65777a0c32cbc7d getconf.c 0d80f37b34a35e3d14b012257c50862dfeb9d2c81139ea2dfa101d981d093b009b9fa450ba27a708ac59377a48626971dfc58e20a3799084a65777a0c32cbc7d getconf.c
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment