[ros-diffs] [cfinck] 36092: Giannis Adamopoulos (johnyadams at hotmail.com) - Check if lpLogFont is NULL, so we don't crash if it is. Verified by the GDI32 Wine test, which explicitly checks for this behaviour and doesn't crash under WinXP SP2. See issue #3725 for more details.

cfinck at svn.reactos.org cfinck at svn.reactos.org
Tue Sep 9 19:49:23 CEST 2008


Author: cfinck
Date: Tue Sep  9 12:49:23 2008
New Revision: 36092

URL: http://svn.reactos.org/svn/reactos?rev=36092&view=rev
Log:
Giannis Adamopoulos (johnyadams at hotmail.com)
- Check if lpLogFont is NULL, so we don't crash if it is.
  Verified by the GDI32 Wine test, which explicitly checks for this behaviour and doesn't crash under WinXP SP2.

See issue #3725 for more details.

Modified:
    trunk/reactos/dll/win32/gdi32/objects/font.c

Modified: trunk/reactos/dll/win32/gdi32/objects/font.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/font.c?rev=36092&r1=36091&r2=36092&view=diff
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/font.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdi32/objects/font.c [iso-8859-1] Tue Sep  9 12:49:23 2008
@@ -391,12 +391,17 @@
 EnumFontFamiliesExA (HDC hdc, LPLOGFONTA lpLogfont, FONTENUMPROCA lpEnumFontFamExProc,
                      LPARAM lParam, DWORD dwFlags)
 {
-  LOGFONTW LogFontW;
-
-  LogFontA2W(&LogFontW, lpLogfont);
+  LOGFONTW LogFontW, *pLogFontW;
+
+  if (lpLogfont)
+  {
+    LogFontA2W(&LogFontW,lpLogfont);
+    pLogFontW = &LogFontW;
+  }
+  else pLogFontW = NULL;
 
   /* no need to convert LogFontW back to lpLogFont b/c it's an [in] parameter only */
-  return IntEnumFontFamilies(hdc, &LogFontW, lpEnumFontFamExProc, lParam, FALSE);
+  return IntEnumFontFamilies(hdc, pLogFontW, lpEnumFontFamExProc, lParam, FALSE);
 }
 
 



More information about the Ros-diffs mailing list