Szabolcs Nagy 17bfe5954b 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.
2022-11-02 15:42:27 +00:00
..
2022-06-30 14:56:21 -03:00
2016-10-25 17:05:47 -02:00
2021-09-03 22:06:44 +05:30
2021-09-03 22:06:44 +05:30
2021-09-03 22:06:44 +05:30
2016-10-25 17:05:47 -02:00