mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-11 09:41:35 +00:00
solve #134
This commit is contained in:
parent
01f0af64da
commit
d40b670388
@ -340,7 +340,7 @@ void* realloc(void* ptr, size_t len) {
|
|||||||
|
|
||||||
int posix_memalign(void** ptr, size_t align, size_t len) {
|
int posix_memalign(void** ptr, size_t align, size_t len) {
|
||||||
|
|
||||||
if (*ptr == NULL) return EINVAL;
|
// if (*ptr == NULL) return EINVAL; // (andrea) Why? I comment it out for now
|
||||||
if ((align % 2) || (align % sizeof(void*))) return EINVAL;
|
if ((align % 2) || (align % sizeof(void*))) return EINVAL;
|
||||||
if (len == 0) {
|
if (len == 0) {
|
||||||
|
|
||||||
@ -348,12 +348,15 @@ int posix_memalign(void** ptr, size_t align, size_t len) {
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t rem = len % align;
|
||||||
|
if (rem) len += align - rem;
|
||||||
|
|
||||||
|
*ptr = __dislocator_alloc(len);
|
||||||
|
|
||||||
if (align >= 4 * sizeof(size_t)) len += align - 1;
|
if (*ptr && len) memset(*ptr, ALLOC_CLOBBER, len);
|
||||||
|
|
||||||
*ptr = malloc(len);
|
DEBUGF("posix_memalign(%p %zu, %zu) [*ptr = %p]", ptr, align, len, *ptr);
|
||||||
|
|
||||||
DEBUGF("posix_memalign(%p %zu, %zu)", ptr, align, len);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -259,11 +259,11 @@ void init_forkserver(char **argv) {
|
|||||||
|
|
||||||
setenv("MSAN_OPTIONS",
|
setenv("MSAN_OPTIONS",
|
||||||
"exit_code=" STRINGIFY(MSAN_ERROR) ":"
|
"exit_code=" STRINGIFY(MSAN_ERROR) ":"
|
||||||
"symbolize=0:"
|
"symbolize=0:"
|
||||||
"abort_on_error=1:"
|
"abort_on_error=1:"
|
||||||
"malloc_context_size=0:"
|
"malloc_context_size=0:"
|
||||||
"allocator_may_return_null=1:"
|
"allocator_may_return_null=1:"
|
||||||
"msan_track_origins=0",
|
"msan_track_origins=0",
|
||||||
0);
|
0);
|
||||||
|
|
||||||
execv(target_path, argv);
|
execv(target_path, argv);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user