bind9/lib
Ondřej Surý 015b390f62
Stop using malloc_usable_size and malloc_size
Although the nanual page of malloc_usable_size says:

    Although the excess bytes can be over‐written by the application
    without ill effects, this is not good programming practice: the
    number of excess bytes in an allocation depends on the underlying
    implementation.

it looks like the premise is broken with _FORTIFY_SOURCE=3 on newer
systems and it might return a value that causes program to stop with
"buffer overflow" detected from the _FORTIFY_SOURCE.  As we do have own
implementation that tracks the allocation size that we can use to track
the allocation size, we can stop relying on this introspection function.

Also the newer manual page for malloc_usable_size changed the NOTES to:

    The value returned by malloc_usable_size() may be greater than the
    requested size of the allocation because of various internal
    implementation details, none of which the programmer should rely on.
    This function is intended to only be used for diagnostics and
    statistics; writing to the excess memory without first calling
    realloc(3) to resize the allocation is not supported.  The returned
    value is only valid at the time of the call.

Remove usage of both malloc_usable_size() and malloc_size() to be on the
safe size and only use the internal size tracking mechanism when
jemalloc is not available.

(cherry picked from commit d61712d14e)
2024-08-27 04:49:55 +02:00
..
bind9 implement 'max-query-restarts' 2024-08-07 15:36:16 -07:00
dns Fix algorithm rollover bug wrt keytag conflicts 2024-08-22 10:15:02 +00:00
irs Properly process extra nameserver lines in resolv.conf 2023-05-16 13:29:33 +10:00
isc Stop using malloc_usable_size and malloc_size 2024-08-27 04:49:55 +02:00
isccc NetBSD has added 'hmac' to libc so rename our uses of hmac 2023-12-14 11:14:04 +11:00
isccfg implement 'max-query-restarts' 2024-08-07 15:36:16 -07:00
ns Process also the ISC_R_CANCELED result code in rpz_rewrite() 2024-08-19 11:45:44 +00:00
.gitignore The isc/platform.h header has been completely removed 2021-07-06 05:33:48 +00:00
Makefile.am move samples/resolve.c to bin/tests/system 2021-04-16 14:29:43 +02:00