Add XtReallocArray() for overflow checking of multiplied args
Uses reallocarray() if available, otherwise checks for overflow itself,
if overflow is possible (i.e. in ILP32 & ILP64 environments, but not LP64
with 32-bit ints).
Includes unit tests and XtMallocArray() helper macro.
Signed-off-by:
Alan Coopersmith <alan.coopersmith@oracle.com>
Showing
- COPYING 1 addition, 1 deletionCOPYING
- configure.ac 9 additions, 1 deletionconfigure.ac
- include/X11/Intrinsic.h 20 additions, 0 deletionsinclude/X11/Intrinsic.h
- man/XtMalloc.man 14 additions, 11 deletionsman/XtMalloc.man
- src/Alloc.c 51 additions, 1 deletionsrc/Alloc.c
- test/Alloc.c 167 additions, 0 deletionstest/Alloc.c
- test/Makefile.am 2 additions, 1 deletiontest/Makefile.am
Loading
Please register or sign in to comment