From 02cfa300e7c74fb1810c09067c49d06768a0adff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sun, 31 Aug 2008 13:59:55 +0000 Subject: [PATCH] fixed memory corruption in wxHTML when parsing '&;' in the markup git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@55388 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + src/html/htmlpars.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index 58510b7635..a83e0f9b14 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -125,6 +125,7 @@ All (GUI): - Fixed problem with Floatable(false) not working in wxAuiFrameManager. - Fixed maximize bug in wxAUI. - Allow period in link anchors in wxHTML. +- Fixed memory corruption in wxHTML when parsing "&;" in the markup. All (Unix): diff --git a/src/html/htmlpars.cpp b/src/html/htmlpars.cpp index 354f2b2466..c2028aa595 100644 --- a/src/html/htmlpars.cpp +++ b/src/html/htmlpars.cpp @@ -572,6 +572,9 @@ wxChar wxHtmlEntitiesParser::GetEntityChar(const wxString& entity) { unsigned code = 0; + if (entity.empty()) + return 0; // invalid entity reference + if (entity[0] == wxT('#')) { const wxChar *ent_s = entity.c_str();