Fix read past allocated buffer when parsing charsets file. (Bug #6413)

This commit is contained in:
jimw@mysql.com 2005-10-11 15:23:34 -07:00
parent 8d01ea1be7
commit 281b8e26d8

View File

@ -81,7 +81,7 @@ static int my_xml_scan(MY_XML_PARSER *p,MY_XML_ATTR *a)
a->beg=p->cur;
a->end=p->cur;
if (!bcmp(p->cur,"<!--",4))
if ((p->end - p->cur > 3) && !bcmp(p->cur,"<!--",4))
{
for( ; (p->cur < p->end) && bcmp(p->cur, "-->", 3); p->cur++)
{}