From 15db3cf513bfa6f7493e82dbaa56bc86ba4e8675 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Fri, 6 Oct 2000 20:22:26 +0000 Subject: [PATCH] fixed bug in parsing incomplete HTML when the very last tag was not closed with > git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8485 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/html/htmltag.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/html/htmltag.cpp b/src/html/htmltag.cpp index 1cb4774643..577728d50a 100644 --- a/src/html/htmltag.cpp +++ b/src/html/htmltag.cpp @@ -59,7 +59,8 @@ wxHtmlTagsCache::wxHtmlTagsCache(const wxString& source) tg = m_CacheSize++; m_Cache[tg].Key = stpos = pos++; dummy[0] = 0; i = 0; - while (src[pos] != wxT('>') && + while (pos < lng && + src[pos] != wxT('>') && src[pos] != wxT(' ') && src[pos] != wxT('\r') && src[pos] != wxT('\n') && src[pos] != wxT('\t')) { dummy[i] = src[pos++]; @@ -70,7 +71,7 @@ wxHtmlTagsCache::wxHtmlTagsCache(const wxString& source) m_Cache[tg].Name = new wxChar[i+1]; memcpy(m_Cache[tg].Name, dummy, (i+1)*sizeof(wxChar)); - while (src[pos] != wxT('>')) pos++; + while (pos < lng && src[pos] != wxT('>')) pos++; if (src[stpos+1] == wxT('/')) { // ending tag: m_Cache[tg].End1 = m_Cache[tg].End2 = -2; -- 2.45.2