]> git.ipfire.org Git - thirdparty/bind9.git/commit
Don't use ssize_t for storing difference between sizes
authorOndřej Surý <ondrej@isc.org>
Thu, 5 Jun 2025 10:19:43 +0000 (12:19 +0200)
committerOndřej Surý <ondrej@isc.org>
Mon, 30 Jun 2025 11:22:39 +0000 (13:22 +0200)
commitf689dc22973f528d375d8e197c9259c2d508c261
tree3bdf29d31300e173e1d1066173a680f8bbda758e
parent560047307d7ac72fd8281e206b10dda7fe6cbdbf
Don't use ssize_t for storing difference between sizes

As POSIX guarantees only that the type ssize_t shall be capable of
storing values at least in the range [-1, {SSIZE_MAX}], it can't be used
to calculate the difference between two memory sizes.  Change the logic
for junk filling to test whether the new size is larger than old size
and then use size_t as the result will be always positive.
lib/isc/mem.c