Sign in
llvm
/
llvm-archive
/
8f5549c70aebe1959d31d684f9f67236e1a7facb
/
.
/
safecode
/
test
/
cstdlib
/
read-002.c
blob: 3bab421879638940d100ce27fa542d0d7f69a229 [
file
] [
log
] [
blame
]
// RUN: test.sh -e -t %t %s
// XFAIL: darwin
#include
<unistd.h>
// A use of read() causing a buffer overflow.
int
main
()
{
int
pipefd
[
2
];
char
buf
[
200
];
pipe
(
pipefd
);
write
(
pipefd
[
1
],
"test"
,
4
);
read
(
pipefd
[
0
],
&
buf
[
199
],
2
);
return
0
;
}