Sign in
llvm
/
llvm-archive
/
f8b4f79771a41ee0a0f02ac90619d37ccd834915
/
.
/
safecode
/
test
/
mem_safety
/
stdlib
/
stdlib-013.c
blob: 06e919fd2933fab421a9e9363719b713ec5d67aa [
file
] [
log
] [
blame
]
/* strcat() with negative pointer index */
#include
<string.h>
#include
<stdlib.h>
int
main
()
{
char
*
c
,
*
x
;
c
=
malloc
(
10
);
c
[
0
]
=
'\0'
;
x
=
&
c
[
2
];
strcat
(&
x
[-
2
],
"This is more than 10"
);
free
(
c
);
return
0
;
}