[PATCH] gdi32: Fixed loop end setting (Coverity)

Marcus Meissner marcus at jet.franken.de
Sat Nov 12 05:09:33 CST 2011


Hi,

commit cb77f9a2 replaced 32 by list->total in the loop condition,
but not here.

Also the TRACE() could in above case access after the end of the elements
array, just use the elf.elfLogFont.lfCharSet variable.

CID 5048

Ciao, Marcus
---
 dlls/gdi32/freetype.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index 743662a..323e357 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -4591,7 +4591,7 @@ static BOOL enum_face_charsets(Face *face, struct enum_charset_list *list,
         if(!face->scalable && face->fs.fsCsb[0] == 0) { /* OEM bitmap */
             elf.elfLogFont.lfCharSet = ntm.ntmTm.tmCharSet = OEM_CHARSET;
             load_script_name( IDS_OEM_DOS, elf.elfScript );
-            i = 32; /* break out of loop */
+            i = list->total; /* break out of loop after enumeration */
         } else if(!(face->fs.fsCsb[0] & list->element[i].mask))
             continue;
         else {
@@ -4603,7 +4603,7 @@ static BOOL enum_face_charsets(Face *face, struct enum_charset_list *list,
         TRACE("enuming face %s full %s style %s charset = %d type %d script %s it %d weight %d ntmflags %08x\n",
               debugstr_w(elf.elfLogFont.lfFaceName),
               debugstr_w(elf.elfFullName), debugstr_w(elf.elfStyle),
-              list->element[i].charset, type, debugstr_w(elf.elfScript),
+              elf.elfLogFont.lfCharSet, type, debugstr_w(elf.elfScript),
               elf.elfLogFont.lfItalic, elf.elfLogFont.lfWeight,
               ntm.ntmTm.ntmFlags);
         /* release section before callback (FIXME) */
-- 
1.7.3.4




More information about the wine-patches mailing list