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 Lars Martin <la...@smb-tec.com> on 2000/08/14 20:03:17 UTC

Bug in org/apache/xerces/readers/StringReader.java (Xerces-J-1.1.3) ?

Hi all,

I don't know if this is an already known bug which I've found in the file
org/apache/xerces/readers/StringReader.java coming with Xerces-J-1.1.3-src.

A part of the stylebook DTDs look like

<!ENTITY % common.att
	id		ID		#IMPLIED
	xml:lang		NMTOKEN	#IMPLIED'>


If I write documents using this DTD I get an IndexOutOfBoundsException in
StringReader.java because the quoted substring() call accesses the fData string
at an illegal index.

	if (index != -1) {
		qname.prefix = fStringPool.addSymbol(fData.substring(nameOffset, index));
		qname.localpart = fStringPool.addSymbol(fData.substring(index, index + fCurrentOffset));
	}
	else {
		qname.localpart = qname.rawname;
	}

Does anybody have a solution for this bug?

Regards,
Lars
-- 
___________________________________________________________________
Lars Martin                                 mailto:lars@smb-tec.com
SMB GmbH                                     http://www.smb-tec.com