From 515e592b9bea0612bc63d8e93239ff35bcf645c7 Mon Sep 17 00:00:00 2001 From: pancake Date: Mon, 21 Feb 2022 18:45:06 +0100 Subject: [PATCH] Fix null deref in bin.symbols ##crash * Reported by cnitlrt via huntr.dev --- libr/bin/p/bin_symbols.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libr/bin/p/bin_symbols.c b/libr/bin/p/bin_symbols.c index 394736cfffbd3..183507d2d2b21 100644 --- a/libr/bin/p/bin_symbols.c +++ b/libr/bin/p/bin_symbols.c @@ -1,4 +1,4 @@ -/* radare - LGPL - Copyright 2018 - pancake */ +/* radare - LGPL - Copyright 2018-2022 - pancake */ #include #include @@ -361,6 +361,9 @@ static RList *symbols(RBinFile *bf) { bool found = false; for (i = 0; i < element->hdr->n_lined_symbols; i++) { RCoreSymCacheElementSymbol *sym = (RCoreSymCacheElementSymbol *)&element->lined_symbols[i]; + if (!sym) { + break; + } ht_uu_find (hash, sym->paddr, &found); if (found) { continue;