From: Paul Eggert Date: Thu, 16 Oct 2003 06:56:14 +0000 (+0000) Subject: Fix address-arithmetic and alloca bugs in fnmatch. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02034062561c826463a212b37cfbd25ec5dd2d47;p=pspp Fix address-arithmetic and alloca bugs in fnmatch. exclude.c cleanups. --- diff --git a/lib/ChangeLog b/lib/ChangeLog index fd99ba93b5..edb933ba3e 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,21 @@ +2003-10-15 Paul Eggert + + * exclude.c: Do not include or . + (SIZE_MAX): Remove. + (new_exclude, add_exclude_file): Initial size no longer needs to + be a power of 2. + (add_exclude, add_exclude_file): Use xnrealloc instead of rolling + our own address arithmetic overflow checking. + + * fnmatch.c (SIZE_MAX): Define if standard headers don't. + (fnmatch): Do not alloca more than 2000 wide characters; + instead, use malloc for large buffers. + Check for address arithmetic overflow, and return -1 + with errno set to ENOMEM in that case. + * fnmatch_loop.c (ALLOCA_LIMIT): New macro. + (NEW_PATTERN): Do not alloca more than 8000 bytes; + instead, return -1. Check for address arithmetic overflow. + 2003-10-14 Paul Eggert Handle invalid suffixes and overflow independently, so that