sboag 99/12/13 00:11:53
Modified: src/org/apache/xalan/xslt ElemNumber.java
Log:
Fixed array out of bounds problem for getAncestorNumbers.
Revision Changes Path
1.4 +1 -1 xml-xalan/src/org/apache/xalan/xslt/ElemNumber.java
Index: ElemNumber.java
===================================================================
RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemNumber.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ElemNumber.java 1999/11/28 04:25:13 1.3
+++ ElemNumber.java 1999/12/13 08:11:53 1.4
@@ -816,7 +816,7 @@
{
counts = new int[nMatchingAncestors];
int countIndex = counts.length - 1; // position to put count into
- while( -1 != nodeIndex )
+ while( (-1 != nodeIndex) && (-1 != countIndex /* defensive hack */) )
{
boolean countIt = false;
if(null != countMatchPattern)