Hi.
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <malloc.h>
void* p[256];
uintptr_t buf[256];
int main() {
p[0] = malloc(-8);
fprintf(stderr, "%p\n", p[0]);
}
This program will crash if we run it with SlimGuard.
The reason is that SlimGuard checks mark_used without validating the return value from previous call, which could be zero( https://github.com/ssrg-vt/SlimGuard/blob/master/src/slimguard.c#L409)
Best,
Insu Yun.