mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2025-05-02 06:16:24 -04:00
Move memory corruption tests up a directory
This commit is contained in:
parent
0bbcc5d610
commit
84eadd8568
42 changed files with 83 additions and 140 deletions
12
test/malloc_object_size_offset.c
Normal file
12
test/malloc_object_size_offset.c
Normal file
|
@ -0,0 +1,12 @@
|
|||
#include <stdbool.h>
|
||||
#include <malloc.h>
|
||||
|
||||
#include "test_util.h"
|
||||
|
||||
size_t malloc_object_size(void *ptr);
|
||||
|
||||
OPTNONE int main(void) {
|
||||
char *p = malloc(16);
|
||||
size_t size = malloc_object_size(p + 5);
|
||||
return size != (SLAB_CANARY ? 19 : 27);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue