From 4072a5bb052b5e79f274d1dd0d5f5ff117359046 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Thu, 16 Sep 2010 22:19:40 +0200 Subject: [PATCH] * rare crash in some weird edge case. don't dereference unchecked pointers... --- libcitadel/lib/wildfire.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libcitadel/lib/wildfire.c b/libcitadel/lib/wildfire.c index 623c3b7c2..7d4499e3c 100644 --- a/libcitadel/lib/wildfire.c +++ b/libcitadel/lib/wildfire.c @@ -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; } -- 2.39.2