linearize.c: fix potential buffer overrun
PATCH 1/1 linearize.c: fix potential buffer overrun
The resulting string won't be nearly 64 bytes, but "buf" is only 16 bytes long here, and this causes FORTIFY_SOURCE to barf when given the right options.
Signed-off-by Jeff Layton <[email protected]>
--- linearize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
linearize.c +1 -1
@@ -91,7 +91,7 @@ const char *show_label(struct basic_block *bb)if (!bb)return ".L???" ; -snprintf (buf,64 ,".L%u" , bb->nr); +snprintf (buf,16 ,".L%u" , bb->nr);return buf; }
Signature · 1 line
2.39.2
Luc Van Oostenryck
AppliedQuoted 5 lines · Jeff Layton
The resulting string won't be nearly 64 bytes, but "buf" is only 16 bytes long here, and this causes
FORTIFY_SOURCEto barf when given the right options.Signed-off-by Jeff Layton <[email protected]>
Pushed to mainline now. Sorry for this very long delay. -- Luc