Sign in
llvm
/
llvm-archive
/
48649d2c83b557841c9e5c978d9ab5af13cb52e5
/
.
/
safecode
/
test
/
mem_safety
/
stdlib
/
stdlib-017.c
blob: cb55f1eb469698d39fe0288f7051f2f6612c0a34 [
file
] [
log
] [
blame
]
/* strlen() out of bounds */
#include
<string.h>
#include
<stdio.h>
int
main
()
{
char
*
string1
=
"A Medium String"
;
char
buf
[
10
];
strncpy
(
buf
,
string1
,
9
);
memset
(
buf
,
'a'
,
10
);
printf
(
"%i\n"
,
strlen
(
buf
));
return
0
;
}