[sanitizer] Fix crash on empty strings.
authorVyacheslav Chigrin <vyacheslav.chigrin@yandex.ru>
Wed, 27 Jan 2021 21:07:37 +0000 (13:07 -0800)
committerEvgenii Stepanov <eugenis@google.com>
Wed, 27 Jan 2021 21:22:43 +0000 (13:22 -0800)
Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D95431

compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cpp

index 710da4c..98418b4 100644 (file)
@@ -356,7 +356,7 @@ void ParseSymbolizePCOutput(const char *str, SymbolizedStack *res) {
       InternalFree(info->function);
       info->function = 0;
     }
-    if (0 == internal_strcmp(info->file, "??")) {
+    if (info->file && 0 == internal_strcmp(info->file, "??")) {
       InternalFree(info->file);
       info->file = 0;
     }