diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2021-04-24 10:45:45 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2021-04-24 10:47:40 -0700 |
commit | a7477abe2943c73bf23f39da2b706ea338d1c9b3 (patch) | |
tree | f72f501606ee663d311db129da10fcf1f1afce15 /m4/stdlib_h.m4 | |
parent | e25cfaa3b59d3d7d8435e9e164a7f92e92c3f64d (diff) | |
download | gnulib-a7477abe2943c73bf23f39da2b706ea338d1c9b3.tar.gz |
reallocarray: check for ptrdiff_t overflow
* doc/glibc-functions/reallocarray.texi (reallocarray):
Mention ptrdiff_t overflow.
* lib/reallocarray.c (reallocarray): Reindent as per usual GNU.
* lib/stdlib.in.h (reallocarray): Allow reallocarray to be replaced.
* m4/reallocarray.m4 (gl_FUNC_REALLOCARRAY):
Check for ptrdiff_t overflow.
* m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Set up REPLACE_REALLOCARRAY.
* modules/reallocarray (Files): Add malloc.m4.
(configure.ac): Also test REPLACE_REALLOCARRAY.
* modules/reallocarray-tests (Depends-on): Add stdint.
* modules/stdlib (stdlib.h): Substitute REPLACE_REALLOCARRAY.
* tests/test-reallocarray.c: Include stdint.h.
(main): Check for ptrdiff_t overflow.
Diffstat (limited to 'm4/stdlib_h.m4')
-rw-r--r-- | m4/stdlib_h.m4 | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/m4/stdlib_h.m4 b/m4/stdlib_h.m4 index 2de57f78c4..9c1d1c76c1 100644 --- a/m4/stdlib_h.m4 +++ b/m4/stdlib_h.m4 @@ -1,4 +1,4 @@ -# stdlib_h.m4 serial 62 +# stdlib_h.m4 serial 63 dnl Copyright (C) 2007-2021 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -179,6 +179,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], REPLACE_RANDOM=0; AC_SUBST([REPLACE_RANDOM]) REPLACE_RANDOM_R=0; AC_SUBST([REPLACE_RANDOM_R]) REPLACE_REALLOC=0; AC_SUBST([REPLACE_REALLOC]) + REPLACE_REALLOCARRAY=0; AC_SUBST([REPLACE_REALLOCARRAY]) REPLACE_REALPATH=0; AC_SUBST([REPLACE_REALPATH]) REPLACE_SETENV=0; AC_SUBST([REPLACE_SETENV]) REPLACE_SETSTATE=0; AC_SUBST([REPLACE_SETSTATE]) |