Add more tests for system calls to deal with bad buffers given to read and write

This commit is contained in:
sBubshait
2024-11-13 16:21:12 +00:00
parent 8bcd0a467c
commit 30e49846b5
12 changed files with 103 additions and 27 deletions

View File

@@ -0,0 +1,17 @@
/* Attempt to overflow the user stack by allocating a 4kB buffer and writing into it.
The process must be terminated with -1 exit code until stack growth has been implemented in Task 3
*/
#include <string.h>
#include <syscall.h>
#include "tests/lib.h"
#include "tests/main.h"
void
test_main (void)
{
char stack_obj[4096];
memset (stack_obj, 'a', sizeof stack_obj);
memset (stack_obj+10, '\0', 1);
msg ("buffer: %s", stack_obj);
}