From: Vadim Zeitlin Date: Thu, 30 Dec 2010 22:36:56 +0000 (+0000) Subject: Don't crash on malformed HTML in wxHTML font tag handler. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/2e49a8074e7c9179b642852ff00ed8fdf0768bb1?ds=inline 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 --- diff --git a/src/html/m_fonts.cpp b/src/html/m_fonts.cpp index 9e69afb79f..422b73c5b9 100644 --- a/src/html/m_fonts.cpp +++ b/src/html/m_fonts.cpp @@ -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