systemc: Make the report handler handle null messages.
authorGabe Black <gabeblack@google.com>
Thu, 23 Aug 2018 02:26:38 +0000 (19:26 -0700)
committerGabe Black <gabeblack@google.com>
Tue, 25 Sep 2018 23:57:24 +0000 (23:57 +0000)
It was checking the first character of the message for a null byte, but
not whether the message string pointer itself was null.

Change-Id: Iddef1e22c35b55c8c898670576ab416dd1023d7c
Reviewed-on: https://gem5-review.googlesource.com/12252
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

src/systemc/utils/sc_report_handler.cc

index 6b259342a64dab85f38944e0ce972ece574d5ca0..e08ad66248466222a8c356acf525bf8e9d3b19f2 100644 (file)
@@ -413,7 +413,7 @@ sc_report_compose_message(const sc_report &report)
     str << report.get_msg_type();
 
     const char *msg = report.get_msg();
-    if (msg[0])
+    if (msg && msg[0])
         str << ": " << msg;
 
     if (report.get_severity() > SC_INFO) {