[PATCH] shell32: check lpFile for NULL before SearchPath (Coverity)

Marcus Meissner marcus at jet.franken.de
Sun Feb 1 04:59:44 CST 2009


Hi,

CID 160, lpFile might be NULL, so check for it and ignore
the option for now.

Ciao, Marcus
---
 dlls/shell32/shlexec.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c
index 1fbaabb..2cf68f1 100644
--- a/dlls/shell32/shlexec.c
+++ b/dlls/shell32/shlexec.c
@@ -150,6 +150,11 @@ static BOOL SHELL_ArgifyW(WCHAR* out, int len, const WCHAR* fmt, const WCHAR* lp
             case '1':
                 if (!done || (*fmt == '1'))
                 {
+                    if (!lpFile) {
+                        FIXME("option %%%c, but lpFile is NULL.\n", *fmt); 
+                        break
+                    }
+
                     /*FIXME Is the call to SearchPathW() really needed? We already have separated out the parameter string in args. */
                     if (SearchPathW(NULL, lpFile, wszExe, sizeof(xlpFile)/sizeof(WCHAR), xlpFile, NULL))
                         cmd = xlpFile;
-- 
1.5.6



More information about the wine-patches mailing list