blob: 39b978d13c5d52bd7398a666ad5e32c1d0b3569e [file] [log] [blame]
/* read out of bounds */
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
char *string = "String";
int main()
{
char *str;
int fds[2];
pipe(fds);
str = malloc(sizeof(string));
write(fds[1], string, sizeof(string));
read(fds[0], &str[-1], sizeof(string));
printf("%s\n", str);
close(fds[0]);
close(fds[1]);
return 0;
}