On 9/29/25 5:15 PM, Collin Funk wrote:
Chet Ramey <[email protected]> writes:On 9/29/25 1:00 AM, Martin D Kealey wrote:The malloc size warning is concerning, as the excessive “size” is (uint64_t)(-1).It seems theoretical, since the line in question is temp = pointer ? realloc (pointer, bytes) : malloc (bytes); and `bytes' is a size_t, which matches realloc's and malloc's prototypes.You can probably just add a check add something like: if (bytes < PTRDIFF_MAX) { errno = ENOMEM; return NULL; } to silence it (although I haven't tested it).
I hate adding code just to silence spurious warnings.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU [email protected] http://tiswww.cwru.edu/~chet/
OpenPGP_signature.asc
Description: OpenPGP digital signature
