[PATCH] Avoid SIGFPE in wordexp [BZ #18100]
Mike Frysinger
vapier@gentoo.org
Fri Mar 20 15:37:00 GMT 2015
On 20 Mar 2015 15:17, Florian Weimer wrote:
change looks fine ... two minor questions below
> --- 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 ?
> + for (const char *const *num = numbers; *num; ++num)
could use ARRAY_SIZE(numbers) rather than a NULL sentinel
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20150320/b6e3acf3/attachment.sig>
More information about the Libc-alpha
mailing list