You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by bu...@apache.org on 2002/04/03 06:52:29 UTC
DO NOT REPLY [Bug 7704] New: -
org.xml.sax.helpers.AttributesImpl can enter infinite loop
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7704>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7704
org.xml.sax.helpers.AttributesImpl can enter infinite loop
Summary: org.xml.sax.helpers.AttributesImpl can enter infinite
loop
Product: Xerces2-J
Version: 2.0.0
Platform: All
OS/Version: All
Status: NEW
Severity: Minor
Priority: Other
Component: SAX
AssignedTo: xerces-j-dev@xml.apache.org
ReportedBy: hurwood@att.net
The following code fragment enters an infinite loop.
-----
import org.xml.sax.helpers.AttributesImpl;
AttributesImpl emptyAttributes = new AttributesImpl();
AttributesImpl copyAttributes = new AttributesImpl(emptyAttributes);
copyAttributes.addAttribute("", "", "", "", "");
-----
It appears that the 'ensureCapacity' function assumes that either the
'data' array is null, or its length is greater than zero. Constructing
an AttributesImpl object from an empty Attributes collection sets
the 'data' array to an array of length zero. Next time 'ensureCapacity' is
called it enters an infinite loop.
The problem can be seen in current CVS version (Revision 1.5)
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org