mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-04 02:18:37 +00:00
20 lines
451 B
C
20 lines
451 B
C
#include <string.h>
|
|
#include <stdlib.h>
|
|
#include <unistd.h>
|
|
#include <sys/types.h>
|
|
#include <sys/stat.h>
|
|
#include <fcntl.h>
|
|
#include <sys/time.h>
|
|
|
|
int main(void)
|
|
{
|
|
int i = 11;
|
|
char* buf = malloc(sizeof(char) * 6);
|
|
char c = buf[-1]; // LoadStoreErr
|
|
char* x = buf + (long)buf; // ArithErr
|
|
char* y = (char*)((long)buf * i); // AsmErr
|
|
write(-1, buf+3, 5); // SysParamErr
|
|
|
|
return x-y+c;
|
|
}
|