This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Avoid SIGFPE in wordexp [BZ #18100]
- From: Florian Weimer <fweimer at redhat dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Fri, 20 Mar 2015 16:41:11 +0100
- Subject: Re: [PATCH] Avoid SIGFPE in wordexp [BZ #18100]
- Authentication-results: sourceware.org; auth=none
- References: <550C2BE2 dot 4000108 at redhat dot com> <20150320153707 dot GF11803 at vapier>
On 03/20/2015 04:37 PM, Mike Frysinger wrote:
> On 20 Mar 2015 15:17, Florian Weimer wrote:
>
> change looks fine ... two minor questions below
Thanks.
>> --- a/posix/wordexp-test.c +++ b/posix/wordexp-test.c + /*
>> Integer overflow in division. */ + { + static const char
>> *const numbers[] = { + "0", + "1", + "65536", +
>> "2147483648", + "4294967296" + "9223372036854775808", +
>> "18446744073709551616", +
>> "170141183460469231731687303715884105728", +
>> "340282366920938463463374607431768211456", + NULL + };
>
> should there be tests for negative numeric limits ?
These tests are for then negative limit, the minus sign is patched
into the pattern. It will be gone on success, that's why it's not
included in the reference array.
>> + for (const char *const *num = numbers; *num; ++num)
(â*numâ should be â*num != NULLâ.)
> could use ARRAY_SIZE(numbers) rather than a NULL sentinel
Sadly, glibc does not seem to provide an ARRAY_SIZE macro for global use.
--
Florian Weimer / Red Hat Product Security