-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
58 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- src/malloc/malloc.c 2023-07-31 20:54:16.000000000 +0300 | ||
+++ src/malloc/malloc.c.patch 2023-12-19 13:23:12.195766831 +0300 | ||
@@ -1075,7 +1075,7 @@ | ||
#include <malloc.h> | ||
|
||
#ifndef RETURN_ADDRESS | ||
-#define RETURN_ADDRESS(X_) (NULL) | ||
+#define RETURN_ADDRESS(X_) mmap(NULL, X_, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) | ||
#endif | ||
|
||
/* Forward declarations. */ | ||
@@ -3532,7 +3532,7 @@ | ||
if (!__malloc_initialized) | ||
ptmalloc_init (); | ||
|
||
- void *address = RETURN_ADDRESS (0); | ||
+ void *address = RETURN_ADDRESS (bytes); | ||
return _mid_memalign (alignment, bytes, address); | ||
} | ||
libc_hidden_def (__libc_memalign) | ||
@@ -3555,7 +3555,7 @@ | ||
return 0; | ||
} | ||
|
||
- void *address = RETURN_ADDRESS (0); | ||
+ void *address = RETURN_ADDRESS (bytes); | ||
return _mid_memalign (alignment, bytes, address); | ||
} | ||
|
||
@@ -3655,7 +3655,7 @@ | ||
if (!__malloc_initialized) | ||
ptmalloc_init (); | ||
|
||
- void *address = RETURN_ADDRESS (0); | ||
+ void *address = RETURN_ADDRESS (bytes); | ||
size_t pagesize = GLRO (dl_pagesize); | ||
return _mid_memalign (pagesize, bytes, address); | ||
} | ||
@@ -3666,7 +3666,7 @@ | ||
if (!__malloc_initialized) | ||
ptmalloc_init (); | ||
|
||
- void *address = RETURN_ADDRESS (0); | ||
+ void *address = RETURN_ADDRESS (bytes); | ||
size_t pagesize = GLRO (dl_pagesize); | ||
size_t rounded_bytes; | ||
/* ALIGN_UP with overflow check. */ | ||
@@ -5901,7 +5901,7 @@ | ||
return EINVAL; | ||
|
||
|
||
- void *address = RETURN_ADDRESS (0); | ||
+ void *address = RETURN_ADDRESS (size); | ||
mem = _mid_memalign (alignment, size, address); | ||
|
||
if (mem != NULL) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters