After having been assigned to a NULL value at dwfl_segment_report_module.c:200,
pointer 'retval' is dereferenced at dwfl_segment_report_module.c:208 by calling 
function 'strcmp'.

Found by RASU JSC.

Signed-off-by: Maks Mishin <maks.mishi...@gmail.com>
---
 libdwfl/dwfl_segment_report_module.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libdwfl/dwfl_segment_report_module.c 
b/libdwfl/dwfl_segment_report_module.c
index dc34e0ae..976d7b79 100644
--- a/libdwfl/dwfl_segment_report_module.c
+++ b/libdwfl/dwfl_segment_report_module.c
@@ -205,7 +205,8 @@ handle_file_note (GElf_Addr module_start, GElf_Addr 
module_end,
        return NULL;
       if (mix == firstix)
        retval = fptr;
-      if (firstix < mix && mix <= lastix && strcmp (fptr, retval) != 0)
+      if (retval != NULL)
+        if (firstix < mix && mix <= lastix && strcmp (fptr, retval) != 0)
        return NULL;
       fptr = fnext + 1;
     }
-- 
2.30.2

Reply via email to