[PATCH] - improve sprintf buffer overflow detection (middle-end/49905)

Joseph Myers joseph@codesourcery.com
Fri Aug 12 15:48:00 GMT 2016


On Thu, 11 Aug 2016, Martin Sebor wrote:

>  *  New target hooks remove hardcoding target-specific assumptions
>     about libc implementation-specific details (%p format and printf
>     floating point rounding mode).

But the rounding mode may vary at runtime; optimally the conversions 
should use the rounding mode set with fesetround.  Determining it with a 
target hook doesn't make sense.  What's more appropriate would be 
determining both rounded-up and rounded-down strings to get bounds on the 
possible length.

> +Warn about function calls with format strings that wite past the end

"write"

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Gcc-patches mailing list