Pointer `symstrdata` is dereferenced at unstrip.c:1977 without checking for 
NULL.

Signed-off-by: Maks Mishin <maks.mishi...@gmail.com>
---
 src/unstrip.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/unstrip.c b/src/unstrip.c
index d70053de..87bd12de 100644
--- a/src/unstrip.c
+++ b/src/unstrip.c
@@ -1974,8 +1974,11 @@ more sections in stripped file than debug file -- 
arguments reversed?"));
            }
        }
 
+    if (symstrdata != NULL)
+  {
       if (dwelf_strtab_finalize (symstrtab, symstrdata) == NULL)
-       error_exit (0, "Not enough memory to create symbol table");
+         error_exit (0, "Not enough memory to create symbol table");
+  }
 
       elf_flagdata (symstrdata, ELF_C_SET, ELF_F_DIRTY);
 
-- 
2.30.2

Reply via email to