https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107619
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |INVALID Status|UNCONFIRMED |RESOLVED --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- After you overflow the buffer, all bets are off. It can but doesn't have to overwrite unrelated variables around, and which exact depends on the optimization flags, architecture and how exactly the compiler decides to lay stuff out. User -fsanitize=address to detect such buffer overflows, fix them and then ubsan behavior will be sane.