[compiler-rt] 262c508 - [sanitizer] Fix crash on empty strings.

Evgenii Stepanov via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 27 13:14:11 PST 2021


Author: Evgenii Stepanov
Date: 2021-01-27T13:08:10-08:00
New Revision: 262c50856a377371cbea673419143ae45c590b7e

URL: https://github.com/llvm/llvm-project/commit/262c50856a377371cbea673419143ae45c590b7e
DIFF: https://github.com/llvm/llvm-project/commit/262c50856a377371cbea673419143ae45c590b7e.diff

LOG: [sanitizer] Fix crash on empty strings.

Patch by Vyacheslav Chigrin.

Reviewed By: eugenis

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

Added: 
    

Modified: 
    compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cpp
index 710da4c1cecd..98418b426c37 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cpp
@@ -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;
     }


        


More information about the llvm-commits mailing list