Commit 974ddbe54c37dd1f8f0f0f11f6f967d6fecd864d

Paul Eggert 2021-04-25T18:24:42

reallocarray: don’t crash if item size is 0 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.