X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..523050b607cfb5e6f9dfcb1544eb4f49ec1978cd:/src/html/htmltag.cpp 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;