summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAnton Moryakov <[email protected]>2025-02-05 00:50:23 +0300
committerMark Wielaard <[email protected]>2025-02-07 23:02:06 +0100
commit6c76ce7331e82a6fc6c2004e8e6ae51ca91f51d7 (patch)
tree3adf3152d32056ef6be505842102194a19c688b4 /tests
parentc89cb740f8f146f72749345fad9c325456447418 (diff)
objdump: Handle elf_getarhdr returning NULL in handle_ar
Report of the static analyzer: Pointer, returned from function 'elf_getarhdr' at objdump.c:314, may be NULL and is dereferenced at objdump.c:317. (CWE-476, CWE-690) Corrections explained: When processing archive elements, the code could dereference a NULL pointer if 'elf_getarhdr' returns NULL. This patch adds a check to ensure 'arhdr' is not NULL before using it. The fix ensures that the function safely handles cases where 'elf_getarhdr' fails, avoiding potential crashes. Triggers found by static analyzer Svace. Signed-off-by: Anton Moryakov <[email protected]>
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions