[Poppler-bugs] [Bug 17676] Uninitialized variable in HtmlFont.cc causes segfault

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Sep 20 06:42:31 PDT 2008


http://bugs.freedesktop.org/show_bug.cgi?id=17676





--- Comment #2 from Tomas Are Haavet <tomasare at gmail.com>  2008-09-20 06:42:02 PST ---
Absolutely, sorry about that. You're thinking of something like this instead?
We only need to assign pos if the fontname variable is NULL.

diff --git a/utils/HtmlFonts.cc b/utils/HtmlFonts.cc
index 3598e7f..ed8656c 100644
--- a/utils/HtmlFonts.cc
+++ b/utils/HtmlFonts.cc
@@ -131,7 +131,8 @@ HtmlFont::HtmlFont(GooString* ftname,int _size, GfxRGB
rgb){
        }
     pos=i;
     delete fontname;
-  }  
+  } else
+    pos = font_num;
   if (!DefaultFont) DefaultFont=new GooString(fonts[font_num].name);

 }


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Poppler-bugs mailing list