Sign in
llvm
/
llvm-archive
/
f91d1660b4827134c7666ae9637f21a2741d183f
/
.
/
safecode
/
test
/
mem_safety
/
stdlib
/
stdlib-012.c
blob: 7292d1e849d6318d0eb0eaf9ba444bf149390f84 [
file
] [
log
] [
blame
]
/* strcat() with not enough destination space in an allocated array */
#include
<string.h>
#include
<stdlib.h>
int
main
()
{
char
*
c
,
*
x
;
c
=
malloc
(
30
);
x
=
&
c
[
25
];
x
[
0
]
=
'\0'
;
strcat
(
x
,
"String"
);
free
(
c
);
return
0
;
}