| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
| |
See: https://www.gnu.org/licenses/gpl-3.0.html#howto
Run:
$ git grep -l 'Foundation; either version 3' \
| xargs sed -i '/Foundation; either version 3/ s/n; e/n, e/'
* All files using GPLv3: Adjust via the above command.
|
| |
|
|
|
|
|
|
| |
* tests/test-reallocarray.c (main): Don’t assume that
PTRDIFF_MAX / 2 + 1 <= SIZE_MAX. POSIX allows platforms
where this isn’t true, though I don’t know of any examples.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* tests/test-malloc-gnu.c: Include "macros.h".
(main): Use ASSERT.
* tests/test-calloc-gnu.c: Include "macros.h".
(main): Use ASSERT.
* tests/test-realloc-gnu.c: Include "macros.h".
(main): Use ASSERT.
* tests/test-reallocarray.c: Include "macros.h".
(main): Use ASSERT.
* modules/malloc-gnu-tests (Files): Add tests/macros.h.
* modules/calloc-gnu-tests (Files): Likewise.
* modules/realloc-gnu-tests (Files): Likewise.
* modules/reallocarray-tests (Files): Likewise.
|
|
|
|
| |
* tests/test-reallocarray.c (main): Accept EOVERFLOW error code.
|
|
|
|
|
|
|
|
|
| |
This problem affects only platforms where xalloc_oversized
divides a number by the size arg. Fix this by defining
xalloc_oversized (n, s) to work even if s == 0.
* lib/malloca.h, lib/xalloc-oversized.h: Document new behavior.
* lib/xalloc-oversized.h (__xalloc_oversized): Do not crash if S==0.
* tests/test-reallocarray.c (main): Test for the bug.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In some more test locations, store the result of malloc etc. into
a volatile pointer so that clang doesn’t optimize away the malloc
and thus bypass the test. This fixes a malloc-gnu test failure on
macOS 11.2.3 with clang 12.0.0 on ARM.
* tests/test-alloca-opt.c (do_allocation):
* tests/test-malloc-gnu.c (main):
* tests/test-malloca.c (do_allocation):
* tests/test-realloc-gnu.c (main):
* tests/test-reallocarray.c (main):
* tests/test-aligned-malloc.c (main):
* tests/test-aligned_alloc.c (main):
Store malloc etc. results into a volatile pointer.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
* doc/glibc-functions/reallocarray.texi: Update version numbers.
* m4/reallocarray.m4 (gl_FUNC_REALLOCARRAY): Don't trust _cv_ contents.
* modules/reallocarray (License): Change from GPL to LGPL.
* tests/test-reallocarray.c (main): Fix ENOMEM typo.
Indent properly and don't use tabs.
|
|
reallocarray is a new function in glibc 2.26 to safely allocate an array
of memory locations with integer overflow protection.
* MODULES.html.sh: Add reallocarray.
* doc/glibc-functions/reallocarray.texi: Documentation for reallocarray.
* lib/reallocarray.c: New file to implement module reallocarray.
* lib/stdlib.in.h: Add function declarations for reallocarray.
* m4/reallocarray.m4: New file.
* m4/stdlib_h.m4: Declare reallocarray.
* modules/reallocarray: New file.
* modules/reallocarray-test: New file.
* modules/stdlib: Coerce stdlib.h to export reallocarray.
* tests/test-reallocarray.c: New test.
|