You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
%g with high precision reads past powers_of_10[] for small values #239
global-buffer-overflow ... 0 bytes after global variable 'powers_of_10'
#0 get_components printf.c:699
#1 print_exponential_number printf.c:1100
In print_exponential_number(), when %g falls back to decimal mode, precision becomes precision - floored_exp10. For a negative exponent this grows past PRINTF_MAX_SUPPORTED_PRECISION, and the following get_components() call indexes powers_of_10[precision] out of bounds. print_floating_point() limits the precision before this point, but the fallback raises it again.
Found by comparing snprintf_() against glibc snprintf() on random format strings and values, built with ASan/UBSan. Seen on master and develop (e2ceeaf).
Activity
Fixes #239: Limit the precision again when %g falls back to decimal mode
Fixes #239: Limit the precision again when %g falls back to decimal mode
Fixes #239: Limit the precision again when %g falls back to decimal mode
Fixes #239: Limit the precision again when %g falls back to decimal mode
Fixes #239: Limit the precision again when %g falls back to decimal mode