http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55896
Marek Polacek <mpolacek at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mpolacek at gcc dot gnu.org --- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> --- I think there's a bug in the program. We inline w_strlen function. Now, if buffer is NULL, we don't compute w_strlen, as the result is 0. But since the call to strncat is strncat(content_2, content_1, w_strlen(content_1) - 1);, we pass -1 as n to strncat, which is casted to size_t, that means we end up with __builtin___strncat_chk (&content_2, &content_1, 18446744073709551615, 1024);.