aboutsummaryrefslogtreecommitdiff
path: root/malloc/alloc_buffer_alloc_array.c
diff options
context:
space:
mode:
authorSzabolcs Nagy <szabolcs.nagy@arm.com>2022-10-11 15:24:41 +0100
committerSzabolcs Nagy <szabolcs.nagy@arm.com>2022-10-27 14:46:46 +0100
commitb6c621077438769cadebdfcc5f5298389e29081c (patch)
treee87b3313a20c11b2207554e75805f2f8ab9de7d8 /malloc/alloc_buffer_alloc_array.c
parent86cb990eeb22d64be6ab4c7ac3c70b507734dfd7 (diff)
downloadglibc-b6c621077438769cadebdfcc5f5298389e29081c.tar.xz
glibc-b6c621077438769cadebdfcc5f5298389e29081c.zip
Fix OOB read in stdlib thousand grouping parsing [BZ #29727]
__correctly_grouped_prefixmb only worked with thousands_len == 1, otherwise it read past the end of cp or thousands. This affects scanf formats like %'d, %'f and the internal but exposed __strto{l,ul,f,d,..}_internal with grouping flag set and an LC_NUMERIC locale where thousands_len > 1. Avoid OOB access by considering thousands_len when initializing cp. This fixes bug 29727. Found by the morello port with strict bounds checking where FAIL: stdlib/tst-strtod4 FAIL: stdlib/tst-strtod5i crashed using a locale with thousands_len==3.
Diffstat (limited to 'malloc/alloc_buffer_alloc_array.c')
0 files changed, 0 insertions, 0 deletions