Skip to content

Commit

Permalink
Someone found a bug hiding in a corner, caught it !
Browse files Browse the repository at this point in the history
- parser.c: fixing bug 52299 strange condition leading
  to a parser crash due to a buffer overflow
- result/noent/attrib.xml result/attrib.xml test/attrib.xml:
  added the specific test case
Daniel
  • Loading branch information
Daniel Veillard committed Mar 20, 2001
1 parent fbf8a2d commit 0b6b55b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
Tue Mar 20 12:22:36 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>

* parser.c: fixing bug 52299 strange condition leading
to a parser crash due to a buffer overflow
* result/noent/attrib.xml result/attrib.xml test/attrib.xml:
added the specific test case

Mon Mar 19 16:50:52 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>

* xpath.[ch]: still a lot of cleanup based on XSLT, added
Expand Down
6 changes: 6 additions & 0 deletions parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -2156,6 +2156,9 @@ xmlParseAttValue(xmlParserCtxtPtr ctxt) {
buf[len++] = *current++;
}
} else {
if (len > buf_size - 10) {
growBuffer(buf);
}
len += xmlCopyChar(0, &buf[len], val);
}
} else {
Expand All @@ -2178,6 +2181,9 @@ xmlParseAttValue(xmlParserCtxtPtr ctxt) {
xmlFree(rep);
}
} else {
if (len > buf_size - 10) {
growBuffer(buf);
}
if (ent->content != NULL)
buf[len++] = ent->content[0];
}
Expand Down
2 changes: 2 additions & 0 deletions result/attrib.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0"?>
<item title="Icrontic.com - Warning: Breakdancing midget with tourette's syndrome on-board&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;" url="http://www.icrontic.com/" first_time="985034339" last_time="985034339" visits="1"/>
2 changes: 2 additions & 0 deletions result/noent/attrib.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0"?>
<item title="Icrontic.com - Warning: Breakdancing midget with tourette's syndrome on-board&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;" url="http://www.icrontic.com/" first_time="985034339" last_time="985034339" visits="1"/>
1 change: 1 addition & 0 deletions test/attrib.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<item title="Icrontic.com - Warning: Breakdancing midget with tourette&apos;s syndrome on-board&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;" url="http://www.icrontic.com/" first_time="985034339" last_time="985034339" visits="1"/>

0 comments on commit 0b6b55b

Please sign in to comment.