From a7477abe2943c73bf23f39da2b706ea338d1c9b3 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 24 Apr 2021 10:45:45 -0700 Subject: 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. --- modules/reallocarray-tests | 1 + 1 file changed, 1 insertion(+) (limited to 'modules/reallocarray-tests') diff --git a/modules/reallocarray-tests b/modules/reallocarray-tests index 3943d7295b..4b61da1435 100644 --- a/modules/reallocarray-tests +++ b/modules/reallocarray-tests @@ -3,6 +3,7 @@ tests/test-reallocarray.c tests/signature.h Depends-on: +stdint configure.ac: -- cgit v1.2.1