From: Alex Ionescu Date: Tue, 26 Jul 2005 00:43:19 +0000 (+0000) Subject: - Don't try to get the length of a possibly empty string. This fixes many menu appli... X-Git-Tag: ReactOS-0.2.8~1594 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=55234f60948f17a6dca0624487bed77ba08b975a - 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? svn path=/trunk/; revision=16728 --- diff --git a/reactos/lib/user32/windows/menu.c b/reactos/lib/user32/windows/menu.c index 56ad7a0b43b..7afb063a344 100644 --- a/reactos/lib/user32/windows/menu.c +++ b/reactos/lib/user32/windows/menu.c @@ -3771,8 +3771,11 @@ GetMenuItemInfoA( } RtlCopyMemory(mii, &miiW, miiW.cbSize); - mii->dwTypeData = AnsiBuffer; - mii->cch = strlen(AnsiBuffer); + if (AnsiBuffer) + { + mii->dwTypeData = AnsiBuffer; + mii->cch = strlen(AnsiBuffer); + } return TRUE; }