diff options
author | Timo Teräs <timo.teras@iki.fi> | 2017-01-12 08:18:00 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2017-01-12 08:19:22 +0200 |
commit | efe30cbdc12299aa0b809bb92ddf68215dab313e (patch) | |
tree | 15c5485dcf78babdd9a9dbf51a5256e6eb414502 /main/musl/0005-treat-base-1-as-an-error-in-strtol-family-functions.patch | |
parent | 9878b048b45f977e69527a88e7f4d205cabccc94 (diff) | |
download | aports-efe30cbdc12299aa0b809bb92ddf68215dab313e.tar.bz2 aports-efe30cbdc12299aa0b809bb92ddf68215dab313e.tar.xz |
main/musl: apply upstream fixes
Diffstat (limited to 'main/musl/0005-treat-base-1-as-an-error-in-strtol-family-functions.patch')
-rw-r--r-- | main/musl/0005-treat-base-1-as-an-error-in-strtol-family-functions.patch | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/main/musl/0005-treat-base-1-as-an-error-in-strtol-family-functions.patch b/main/musl/0005-treat-base-1-as-an-error-in-strtol-family-functions.patch new file mode 100644 index 0000000000..77c72a68e0 --- /dev/null +++ b/main/musl/0005-treat-base-1-as-an-error-in-strtol-family-functions.patch @@ -0,0 +1,31 @@ +From 809ff8cf90254921ea38eb6fa1ce326d9008513b Mon Sep 17 00:00:00 2001 +From: Rich Felker <dalias@aerifal.cx> +Date: Wed, 4 Jan 2017 19:48:21 -0500 +Subject: [PATCH] treat base 1 as an error in strtol-family functions + +ISO C and POSIX only specify behavior for base arguments of 0 and +2-36; POSIX mandates an EINVAL error for unsupported bases. it's not +clear that there's a requirement for implementations not to "support" +additional bases as an extension, but "base 1" did not work in any +meaningful way anyway, so it should be considered unsupported and thus +an error. +--- + src/internal/intscan.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/internal/intscan.c b/src/internal/intscan.c +index 65d497ec..a4a5ae86 100644 +--- a/src/internal/intscan.c ++++ b/src/internal/intscan.c +@@ -29,7 +29,7 @@ unsigned long long __intscan(FILE *f, unsigned base, int pok, unsigned long long + int c, neg=0; + unsigned x; + unsigned long long y; +- if (base > 36) { ++ if (base > 36 || base == 1) { + errno = EINVAL; + return 0; + } +-- +2.11.0 + |