Changed allocation of arguments in SearchPathA so path is not limited by size of TEB static buffer

Alexander Yaworsky yaworsky at migusoft.ru
Tue Nov 16 20:23:25 CST 2004


ChangeLog:

Changed allocation of arguments in SearchPathA so path is not limited
by size of TEB static buffer.

Index: dlls/kernel/path.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/path.c,v
retrieving revision 1.15
diff -u -r1.15 path.c
--- dlls/kernel/path.c	8 Oct 2004 21:01:44 -0000	1.15
+++ dlls/kernel/path.c	17 Nov 2004 03:09:25 -0000
@@ -819,17 +819,17 @@
      WCHAR bufferW[MAX_PATH];
      DWORD ret;

-    if (!(pathW = FILE_name_AtoW( path, FALSE ))) return 0;
-    if (name && !(nameW = FILE_name_AtoW( name, TRUE ))) return 0;
+    if (name && !(nameW = FILE_name_AtoW( name, FALSE ))) return 0;
+    if (!(pathW = FILE_name_AtoW( path, TRUE ))) return 0;
      if (ext && !(extW = FILE_name_AtoW( ext, TRUE )))
      {
-        if (nameW) HeapFree( GetProcessHeap(), 0, nameW );
+        HeapFree( GetProcessHeap(), 0, pathW );
          return 0;
      }

      ret = SearchPathW(pathW, nameW, extW, MAX_PATH, bufferW, NULL);

-    if (nameW) HeapFree( GetProcessHeap(), 0, nameW );
+    HeapFree( GetProcessHeap(), 0, pathW );
      if (extW) HeapFree( GetProcessHeap(), 0, extW );

      if (!ret) return 0;




More information about the wine-patches mailing list