Commit 9f8fb7aa authored by Steven Boswell's avatar Steven Boswell Committed by Albert Astals Cid

HtmlFont: Fix possible uninitialized variable & dangling reference

Bug #107316
parent 1f8ab328
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment