Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
malloc_usable_size.3: The returned value should not be trusted
It might very well return a value larger than the actual usable size, so writing to the excess bytes is Undefined Behavior. There's absolutely no promise about the value, except that it is no less than the size that was once passed to malloc(3). Link: <systemd/systemd#22801 (comment)> Link: <https://inbox.sourceware.org/libc-alpha/20221124213258.305192-1-siddhesh@gotplt.org/T/> Reported-by: Mingye Wang <arthur200126@gmail.com> Reported-by: Siddhesh Poyarekar <siddhesh@gotplt.org> Cc: DJ Delorie <dj@redhat.com> Cc: Sam James <sam@gentoo.org> Cc: Florian Weimer <fweimer@redhat.com> Cc: Andreas Schwab <schwab@linux-m68k.org> Cc: Zack Weinberg <zack@owlfolio.org> Cc: Wilco Dijkstra <Wilco.Dijkstra@arm.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
- Loading branch information