mirror of
				https://github.com/GrapheneOS/hardened_malloc.git
				synced 2025-11-04 09:46:32 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			15 lines
		
	
	
	
		
			288 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
	
		
			288 B
		
	
	
	
		
			C
		
	
	
	
	
	
#include <stdlib.h>
 | 
						|
 | 
						|
#include <sys/mman.h>
 | 
						|
 | 
						|
#include "test_util.h"
 | 
						|
 | 
						|
OPTNONE int main(void) {
 | 
						|
    free(malloc(16));
 | 
						|
    char *p = mmap(NULL, 4096 * 16, PROT_NONE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
 | 
						|
    if (p == MAP_FAILED) {
 | 
						|
        return 1;
 | 
						|
    }
 | 
						|
    free(p + 4096 * 8);
 | 
						|
    return 0;
 | 
						|
}
 |