forked from bminor/newlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CR MOLY00701812: Fix heap buffer overrun in _dtoa_r
Original algorithm would allocate smallest n = 2 pow (2k) bytes where k is in [1, 16] and n is *larger* than i, thus at least one byte larger. Enough to hold the null terminator. newlib/ * libc/stdlib/dtoa.c (_dtoa_r)[USE_MALLOC_DTOA]: Reserve one byte more to hold the null terminator. * testsuite/newlib.stdio/printf.c (GUARD_SIZE): New define. (_malloc_r): Fill GUARD_SIZE region after initial allocation. (_free_r): Check GUARD_SIZE region content.
- Loading branch information
Dragan Mladjenovic
authored and
Dragan Mladjenovic
committed
Aug 5, 2021
1 parent
e78a11a
commit 6da0ef6
Showing
2 changed files
with
48 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters