[ros-diffs] [ion] 16728: - Don't try to get the length of a possibly empty string. This fixes many menu applications (such as WinRAR). However I'm now getting a bug due to a double-free. It seems a GDI Object is being freed twice. Can anyone check this out please?

ion at svn.reactos.com ion at svn.reactos.com
Tue Jul 26 02:43:22 CEST 2005


- Don't try to get the length of a possibly empty string. This fixes
many menu applications (such as WinRAR). However I'm now getting a bug
due to a double-free. It seems a GDI Object is being freed twice. Can
anyone check this out please?
Modified: trunk/reactos/lib/user32/windows/menu.c
  _____  

Modified: trunk/reactos/lib/user32/windows/menu.c
--- trunk/reactos/lib/user32/windows/menu.c	2005-07-25 23:19:12 UTC
(rev 16727)
+++ trunk/reactos/lib/user32/windows/menu.c	2005-07-26 00:43:19 UTC
(rev 16728)
@@ -3771,8 +3771,11 @@

    }
 
    RtlCopyMemory(mii, &miiW, miiW.cbSize);
-   mii->dwTypeData = AnsiBuffer;
-   mii->cch = strlen(AnsiBuffer);
+   if (AnsiBuffer)
+   {
+        mii->dwTypeData = AnsiBuffer;
+        mii->cch = strlen(AnsiBuffer);
+   }
    return TRUE;
 }
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20050726/724e803f/attachment.html


More information about the Ros-diffs mailing list