[poppler] utils/HtmlFonts.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Thu Aug 9 14:16:47 UTC 2018


 utils/HtmlFonts.cc |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 9f8fb7aae92268c9460434abd4d970f04a9af926
Author: Steven Boswell <ulatekh at yahoo.com>
Date:   Thu Aug 9 16:16:10 2018 +0200

    HtmlFont: Fix possible uninitialized variable & dangling reference
    
    Bug #107316

diff --git a/utils/HtmlFonts.cc b/utils/HtmlFonts.cc
index 250909b3..97478c3c 100644
--- a/utils/HtmlFonts.cc
+++ b/utils/HtmlFonts.cc
@@ -168,7 +168,7 @@ HtmlFont::HtmlFont(const HtmlFont& x){
    bold=x.bold;
    pos=x.pos;
    color=x.color;
-   if (x.FontName) FontName=new GooString(x.FontName);
+   FontName = (x.FontName) ? new GooString(x.FontName) : nullptr;
    rotOrSkewed = x.rotOrSkewed;
    memcpy(rotSkewMat, x.rotSkewMat, sizeof(rotSkewMat));
  }
@@ -187,7 +187,7 @@ HtmlFont& HtmlFont::operator=(const HtmlFont& x){
    pos=x.pos;
    color=x.color;
    if (FontName) delete FontName;
-   if (x.FontName) FontName=new GooString(x.FontName);
+   FontName = (x.FontName) ? new GooString(x.FontName) : nullptr;
    return *this;
 }
 


More information about the poppler mailing list