aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/ubsan/pr78858.c
blob: ad0af42caca806d9ebfc485624a2de0dae0b619d (plain)
1
2
3
4
5
6
7
8
9
10
/* PR middle-end/78858 */
/* { dg-do compile } */
/* { dg-options "-fsanitize=undefined -Wnonnull" } */

void
foo (char **x, const char *y)
{
  *x = (char *) __builtin_malloc (__builtin_strlen (y) + 1);	/* { dg-bogus "argument 1 null where non-null expected" } */
  __builtin_strcpy (*x, y);
}