From 3f6901ad7f0acb262134cc634f875b0bf2153ed6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 3 May 2008 00:39:44 +0000 Subject: [PATCH] don't return junk from wxHtmlTag::GetParamAsInt() if the parameter is not an integer (this resulted in practically infinite loop in table parsing code for bad HTML with incorrect colspan values) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53432 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/html/htmltag.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/html/htmltag.cpp b/src/html/htmltag.cpp index 46baaea4df..3369fc82c3 100644 --- a/src/html/htmltag.cpp +++ b/src/html/htmltag.cpp @@ -524,11 +524,15 @@ bool wxHtmlTag::GetParamAsColour(const wxString& par, wxColour *clr) const bool wxHtmlTag::GetParamAsInt(const wxString& par, int *clr) const { - if (!HasParam(par)) return false; + if ( !HasParam(par) ) + return false; + long i; - bool succ = GetParam(par).ToLong(&i); + if ( !GetParam(par).ToLong(&i) ) + return false; + *clr = (int)i; - return succ; + return true; } wxString wxHtmlTag::GetAllParams() const