Simple arguments check

Mike Hearn mike at theoretic.com
Sat Dec 27 05:58:31 CST 2003


Mike Hearn <mike at theoretic.com>
Check pszPath argument for NULL. Prevents a crash in an installer.

Index: dlls/shell32/pidl.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/pidl.c,v
retrieving revision 1.94
diff -u -r1.94 pidl.c
--- dlls/shell32/pidl.c 4 Nov 2003 04:21:01 -0000       1.94
+++ dlls/shell32/pidl.c 25 Dec 2003 19:32:48 -0000
@@ -1234,10 +1234,19 @@
        LPSHELLFOLDER shellfolder;
  
        TRACE_(shell)("(pidl=%p,%p)\n",pidl,pszPath);
-       pdump(pidl);
  
-       if (!pidl) return FALSE;
+       if (!pidl) {
+           ERR_(shell)("argument check failed: pidl == null\n");
+           return FALSE;
+       }
+
+       if (!pszPath) {
+           ERR_(shell)("argument check failed: pszPath == null\n");
+           return FALSE;
+       }
  
+       pdump(pidl);
+
        hr = SHGetDesktopFolder(&shellfolder);
        if (SUCCEEDED (hr)) {
            hr = IShellFolder_GetDisplayNameOf(shellfolder,pidl,SHGDN_FORPARSING,&str);
@@ -1260,10 +1269,19 @@
        LPSHELLFOLDER shellfolder;
  
        TRACE_(shell)("(pidl=%p,%p)\n", pidl, debugstr_w(pszPath));
-       pdump(pidl);
-
-       if (!pidl) return FALSE;
+
+       if (!pidl) {
+           ERR_(shell)("argument check failed: pidl == null\n");
+           return FALSE;
+       }
+
+       if (!pszPath) {
+           ERR_(shell)("argument check failed: pszPath == null\n");
+           return FALSE;
+       }
  
+       pdump(pidl);
+
        hr = SHGetDesktopFolder(&shellfolder);
        if (SUCCEEDED(hr)) {
            hr = IShellFolder_GetDisplayNameOf(shellfolder, pidl, SHGDN_FORPARSING, &str);





More information about the wine-patches mailing list