https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71296

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
Another problem is with strcat appending to a buffer initialized using the
array notation like below where it also assumes it's starting at the beginning
of the buffer (and so only diagnoses writes in excess of its full size).

void f (void)
{
  {
    char a [4] = { '1', '2', '3', '\0' };
    strcat (a, "456");   // buffer overflow not diagnosed
    sink (a);
  }
}

Reply via email to