Don't crash on malformed HTML in wxHTML font tag handler.
Don't try to access the first character of the size parameter value before we are sure that it is not empty. Closes #12812. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66492 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
b4c470164c
commit
2e49a8074e
1 changed files with 4 additions and 3 deletions
|
|
@ -51,10 +51,11 @@ TAG_HANDLER_BEGIN(FONT, "FONT" )
|
|||
|
||||
if (tag.HasParam(wxT("SIZE")))
|
||||
{
|
||||
int tmp = 0;
|
||||
wxChar c = tag.GetParam(wxT("SIZE")).GetChar(0);
|
||||
if (tag.GetParamAsInt(wxT("SIZE"), &tmp))
|
||||
long tmp = 0;
|
||||
const wxString sizeStr = tag.GetParam(wxT("SIZE"));
|
||||
if (sizeStr.ToLong(&tmp))
|
||||
{
|
||||
wxChar c = sizeStr[0];
|
||||
if (c == wxT('+') || c == wxT('-'))
|
||||
m_WParser->SetFontSize(oldsize+tmp);
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue