From 649ffc6d4b89aa5fcd609e520763f210eb8fce88 Mon Sep 17 00:00:00 2001 From: "Andrey A. Chernov" Date: Wed, 28 Nov 2001 02:17:22 +0000 Subject: [PATCH] Put back base > 35 check. If someone dislike it, plese discuss it with standards group first. --- lib/libc/stdlib/strtol.c | 2 +- lib/libc/stdlib/strtoll.c | 2 +- lib/libc/stdlib/strtoul.c | 2 +- lib/libc/stdlib/strtoull.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/libc/stdlib/strtol.c b/lib/libc/stdlib/strtol.c index 10d7425c0f89..07728944f4d7 100644 --- a/lib/libc/stdlib/strtol.c +++ b/lib/libc/stdlib/strtol.c @@ -87,7 +87,7 @@ strtol(nptr, endptr, base) if (base == 0) base = c == '0' ? 8 : 10; acc = any = 0; - if (base < 2) + if (base < 2 || base > 35) goto noconv; /* diff --git a/lib/libc/stdlib/strtoll.c b/lib/libc/stdlib/strtoll.c index 5d656c1bee3c..2992ec83f1e8 100644 --- a/lib/libc/stdlib/strtoll.c +++ b/lib/libc/stdlib/strtoll.c @@ -86,7 +86,7 @@ strtoll(nptr, endptr, base) if (base == 0) base = c == '0' ? 8 : 10; acc = any = 0; - if (base < 2) + if (base < 2 || base > 35) goto noconv; /* diff --git a/lib/libc/stdlib/strtoul.c b/lib/libc/stdlib/strtoul.c index e952663c533e..e9046b0d285a 100644 --- a/lib/libc/stdlib/strtoul.c +++ b/lib/libc/stdlib/strtoul.c @@ -84,7 +84,7 @@ strtoul(nptr, endptr, base) if (base == 0) base = c == '0' ? 8 : 10; acc = any = 0; - if (base < 2) + if (base < 2 || base > 35) goto noconv; cutoff = ULONG_MAX / base; diff --git a/lib/libc/stdlib/strtoull.c b/lib/libc/stdlib/strtoull.c index 15a097221188..3e9b40077d6f 100644 --- a/lib/libc/stdlib/strtoull.c +++ b/lib/libc/stdlib/strtoull.c @@ -84,7 +84,7 @@ strtoull(nptr, endptr, base) if (base == 0) base = c == '0' ? 8 : 10; acc = any = 0; - if (base < 2) + if (base < 2 || base > 35) goto noconv; cutoff = ULLONG_MAX / base;