* stdio-common/reg-modifier.c: The wchar in str can be greater or equal
than 0, and less or equal than UCHAR_MAX, that means, we need a buffer
with UCHAR_MAX + 1 elements, so that user input will not overflow
__printf_modifier_table.
Signed-off-by: Rocket Ma <marocketbd@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
if (__printf_modifier_table == NULL)
{
- __printf_modifier_table = calloc (UCHAR_MAX,
+ __printf_modifier_table = calloc (UCHAR_MAX + 1,
sizeof (*__printf_modifier_table));
if (__printf_modifier_table == NULL)
goto out;