comparison lib/ChangeLog @ 4872:c5afc99b8ce5

Use xsize.h to protect against memory size overflows.
author Bruno Haible <bruno@clisp.org>
date Mon, 17 Nov 2003 15:14:21 +0000
parents 1ca4f3678daf
children 310bf22ff300
comparison
equal deleted inserted replaced
4871:87df35000dab 4872:c5afc99b8ce5
1 2003-11-16 Paul Eggert <eggert@twinsun.com>
2 Bruno Haible <bruno@clisp.org>
3
4 Protect against address arithmetic overflow.
5 * printf-args.h: Include stddef.h.
6 (arguments): Change type of field 'count' to size_t.
7 * printf-args.c (printf_fetchargs): Use size_t instead of
8 'unsigned int' where appropriate.
9 * printf-parse.h: Include sys/types.h.
10 (char_directive): Change type of *arg_index fields to ssize_t.
11 (char_directives): Change type of fields 'count', max_*_length to
12 size_t.
13 * printf-parse.c: Include sys/types.h and xsize.h.
14 (SSIZE_MAX): Define fallback value.
15 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
16 instead of 'int' where appropriate. Check a_allocated, d_allocated
17 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
18 * vasnprintf.c: Include xsize.h.
19 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
20 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
21 overflow. Avoid wraparound when converting a width or precision from
22 decimal to binary.
23
24 2003-11-16 Bruno Haible <bruno@clisp.org>
25
26 Update from GNU gettext.
27 * printf-parse.c: Generalize to it can be compiled for wide strings.
28 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
29 * vasnprintf.c: Generalize to it can be compiled for wide strings.
30 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
31 SNPRINTF): New macros.
32 Don't include <alloca.h> if the file is used inside libintl.
33 (local_wcslen): New function, for Solaris 2.5.1.
34 (VASNPRINTF): Use it instead of wcslen.
35
1 2003-11-16 Bruno Haible <bruno@clisp.org> 36 2003-11-16 Bruno Haible <bruno@clisp.org>
2 37
3 * xsize.h (xmax): New function. 38 * xsize.h (xmax): New function.
4 (xsum, xsum3, xsum4): Declare as "pure" functions. 39 (xsum, xsum3, xsum4): Declare as "pure" functions.
5 40