Skip to content

Commit 8bef13e

Browse files
authored
[hwasan] Fix a possible null dereference problem (#77737)
This is clearly a copy-paste mistake, fix it with this patch. After checking the `local.function_name` is not null, it should check the len for `local.function_name`, not `local.name`. And this could lead to possible null dereference since the second `internal_strlen(local.name)` does not guarantee `local.name` is not null.
1 parent 25063be commit 8bef13e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler-rt/lib/hwasan/hwasan_report.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ static void PrintStackAllocations(const StackAllocationsRingBuffer *sa,
222222
if (!local.has_frame_offset || !local.has_size || !local.has_tag_offset)
223223
continue;
224224
if (!(local.name && internal_strlen(local.name)) &&
225-
!(local.function_name && internal_strlen(local.name)) &&
225+
!(local.function_name && internal_strlen(local.function_name)) &&
226226
!(local.decl_file && internal_strlen(local.decl_file)))
227227
continue;
228228
tag_t obj_tag = base_tag ^ local.tag_offset;

0 commit comments

Comments
 (0)