Francois Gouget : shell32: Fix FindExecutableW() to not check if lpResult after using it. It' s supposed to cause a segfault anyway.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Dec 14 07:03:42 CST 2006


Module: wine
Branch: master
Commit: df9715b1b0980cfb513153ec2ad8df598aa7d913
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=df9715b1b0980cfb513153ec2ad8df598aa7d913

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Wed Dec 13 18:07:42 2006 +0100

shell32: Fix FindExecutableW() to not check if lpResult after using it. It's supposed to cause a segfault anyway.

Use SE_ERR_FNF rather than a numeric literal.

---

 dlls/shell32/shlexec.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c
index 2950ad8..f49382a 100644
--- a/dlls/shell32/shlexec.c
+++ b/dlls/shell32/shlexec.c
@@ -1013,13 +1013,8 @@ HINSTANCE WINAPI FindExecutableW(LPCWSTR
           (lpFile != NULL ? debugstr_w(lpFile) : "-"), (lpDirectory != NULL ? debugstr_w(lpDirectory) : "-"));
 
     lpResult[0] = '\0'; /* Start off with an empty return string */
-
-    /* trap NULL parameters on entry */
-    if ((lpFile == NULL) || (lpResult == NULL))
-    {
-        /* FIXME - should throw a warning, perhaps! */
-	return (HINSTANCE)2; /* File not found. Close enough, I guess. */
-    }
+    if (lpFile == NULL)
+	return (HINSTANCE)SE_ERR_FNF;
 
     if (lpDirectory)
     {




More information about the wine-cvs mailing list