[PATCH] Make strlen range computations more conservative

Jakub Jelinek jakub@redhat.com
Tue Jul 31 06:38:00 GMT 2018


On Mon, Jul 30, 2018 at 09:45:49PM -0600, Martin Sebor wrote:
> Even without _FORTIFY_SOURCE GCC diagnoses (some) writes past
> the end of subobjects by string functions.  With _FORTIFY_SOURCE=2
> it calls abort.  This is the default on popular distributions,

Note that _FORTIFY_SOURCE=2 is the mode that goes beyond what the standard
requires, imposes extra requirements.  So from what this mode accepts or
rejects we shouldn't determine what is or isn't considered valid.

	Jakub



More information about the Gcc-patches mailing list