Skip to content
Snippets Groups Projects
Commit de840c7c authored by h2-addad's avatar h2-addad
Browse files

Upload New File

parent 0775f2e2
Branches
No related tags found
No related merge requests found
/* Reads from a file into a bad address.
The process must be terminated with -1 exit code. */
#include <syscall.h>
#include "tests/lib.h"
#include "tests/main.h"
void
test_main (void)
{
int handle;
CHECK ((handle = open ("sample.txt")) > 1, "open \"sample.txt\"");
read (handle, (char *) &handle - 4096, 1);
fail ("survived reading data into bad address");
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment