* rare crash in some weird edge case. don't dereference unchecked pointers...
authorWilfried Goesgens <dothebart@citadel.org>
Thu, 16 Sep 2010 20:19:40 +0000 (22:19 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Thu, 16 Sep 2010 20:19:40 +0000 (22:19 +0200)
libcitadel/lib/wildfire.c

index 623c3b7c23a25d40b1b75293b081b8e1eed108e7..7d4499e3c036938e3056e4c4f226350eeee2cf26 100644 (file)
@@ -157,9 +157,13 @@ static int addr2lineBacktrace(StrBuf *Function,
        pche = strchr(pch, ':');
        FlushStrBuf(FileName);
        StrBufAppendBufPlain(FileName, pch, pche - pch, 0);
-       pche++;
-       *FunctionLine = atoi(pche);
-
+       if (pche != NULL)
+       {
+               pche++;
+               *FunctionLine = atoi(pche);
+       }
+       else 
+               *FunctionLine = 0;
        return 1;
 }