Blob Blame History Raw
commit 87221aeb66e3e3475bf6df77cc7b6338313d0946
Author: Ding Hui <dinghui@sangfor.com.cn>
Date:   Fri Nov 27 13:27:34 2020 -0500

    PR26958: avoid null-deref in buildid verification failure diagnostic
    
    We can't traverse tsk-> if it's NULL.
    
    Tested by <fche> on hand-modified "stap -kp4" stap-symbols.c file.

diff --git a/runtime/sym.c b/runtime/sym.c
index a51f08c9e..521aebe48 100644
--- a/runtime/sym.c
+++ b/runtime/sym.c
@@ -735,7 +735,7 @@ static int _stp_build_id_check (struct _stp_module *m,
 	  // we make sure below is really a warning.
           _stp_warn ("Build-id mismatch [man warning::buildid]: \"%s\" pid %ld address "
 		     "%#lx, expected %s actual %s\n",
-                     m->path, (long) tsk->tgid,
+                     m->path, (long) (tsk ? tsk->tgid : 0),
                      notes_addr, hexstring_theory, hexstring_practice);
       return 1;
   }