mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2025-04-19 22:10:19 +02:00
Fix wrong pointer being checked for NULL in ternary
It's the region pointer that can be NULL here, and p was checked at the beginning of the function.
This commit is contained in:
parent
e33365564b
commit
3c392a7fe7
1 changed files with 1 additions and 1 deletions
|
@ -1693,7 +1693,7 @@ EXPORT size_t h_malloc_object_size(void *p) {
|
||||||
struct region_allocator *ra = ro.region_allocator;
|
struct region_allocator *ra = ro.region_allocator;
|
||||||
mutex_lock(&ra->lock);
|
mutex_lock(&ra->lock);
|
||||||
struct region_metadata *region = regions_find(p);
|
struct region_metadata *region = regions_find(p);
|
||||||
size_t size = p == NULL ? SIZE_MAX : region->size;
|
size_t size = region == NULL ? SIZE_MAX : region->size;
|
||||||
mutex_unlock(&ra->lock);
|
mutex_unlock(&ra->lock);
|
||||||
|
|
||||||
thread_seal_metadata();
|
thread_seal_metadata();
|
||||||
|
|
Loading…
Add table
Reference in a new issue