[PATCH] dbghelp: Handle NULL srcfile in compile_file_regex (Coverity)

Marcus Meissner marcus at jet.franken.de
Mon Feb 9 01:06:17 CST 2009


Hi,

CID 884, srcfile is supposed to be able to be NULL I think, so handle it.

Ciao, Marcus
---
 dlls/dbghelp/symbol.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c
index 9e66f00..5212e56 100644
--- a/dlls/dbghelp/symbol.c
+++ b/dlls/dbghelp/symbol.c
@@ -127,8 +127,11 @@ static BOOL compile_file_regex(regex_t* re, const char* srcfile)
 {
     char *mask, *p;
     BOOL ret;
+    DWORD len = 0;
 
-    p = mask = HeapAlloc(GetProcessHeap(), 0, 5 * strlen(srcfile) + 4);
+    if (srcfile)
+        len = 5*strlen(srcfile);
+    p = mask = HeapAlloc(GetProcessHeap(), 0, len + 4);
     *p++ = '^';
     if (!srcfile || !*srcfile) *p++ = '*';
     else while (*srcfile)
-- 
1.5.6



More information about the wine-patches mailing list