mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Fill uninitialized memory with int3
This commit is contained in:
parent
131fc9c074
commit
3d53ee1761
1 changed files with 5 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <assert.h>
|
||||
|
||||
|
@ -154,6 +155,10 @@ uint8_t* alloc_exec_mem(uint32_t mem_size)
|
|||
exit(-1);
|
||||
}
|
||||
|
||||
// Fill the executable memory with 0x13 so that
|
||||
// executing uninitialized memory will fault
|
||||
memset(mem_block, 0xCC, mem_size);
|
||||
|
||||
return mem_block;
|
||||
#else
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in a new issue