Meta: Avoid showing elements in extremely large vectors in gdb
This is most often just an invalid vector anyway.
This commit is contained in:
parent
899888bbf2
commit
265dd9b445
Notes:
sideshowbarker
2024-07-17 16:21:00 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/265dd9b445 Pull-request: https://github.com/SerenityOS/serenity/pull/13419 Reviewed-by: https://github.com/bgianfo ✅
1 changed files with 4 additions and 0 deletions
|
@ -251,6 +251,10 @@ class AKVector:
|
|||
else:
|
||||
elements = get_field_unalloced(self.val, "m_inline_buffer_storage", inner_type_ptr)
|
||||
|
||||
# Very arbitrary limit, just to catch UAF'd and garbage vector values with a silly number of elements
|
||||
if vec_len > 373373:
|
||||
return []
|
||||
|
||||
return [(f"[{i}]", elements[i]) for i in range(vec_len)]
|
||||
|
||||
@classmethod
|
||||
|
|
Loading…
Add table
Reference in a new issue