From c4641c1dc73700968ee90de85e04b2f32fbadc8a Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Wed, 23 Apr 2014 21:06:41 +0000 Subject: Audit malloc(3)/calloc(3)/realloc(3) usage. * Change eight reallocs to reallocarray to be safe from overflows. * Change one malloc to reallocarray to be safe from overflows. * Change one calloc to reallocarray, no zeroing needed. * Change the order of arguments of three callocs (aesthetical). --- test-reallocarray.c | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 test-reallocarray.c (limited to 'test-reallocarray.c') diff --git a/test-reallocarray.c b/test-reallocarray.c new file mode 100644 index 00000000..9a514e8e --- /dev/null +++ b/test-reallocarray.c @@ -0,0 +1,7 @@ +#include + +int +main(void) +{ + return( ! reallocarray(NULL, 2, 2)); +} -- cgit v1.2.3-56-ge451