You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tika.apache.org by ni...@apache.org on 2013/06/25 17:00:23 UTC

svn commit: r1496507 - /tika/trunk/tika-core/src/main/java/org/apache/tika/sax/ToXMLContentHandler.java

Author: nick
Date: Tue Jun 25 15:00:22 2013
New Revision: 1496507

URL: http://svn.apache.org/r1496507
Log:
Patch from Dietmar Glachs from TIKA-1070 - avoid stackoverflow in ToXMLContentHandler by resetting the parent state after the end of an element

Modified:
    tika/trunk/tika-core/src/main/java/org/apache/tika/sax/ToXMLContentHandler.java

Modified: tika/trunk/tika-core/src/main/java/org/apache/tika/sax/ToXMLContentHandler.java
URL: http://svn.apache.org/viewvc/tika/trunk/tika-core/src/main/java/org/apache/tika/sax/ToXMLContentHandler.java?rev=1496507&r1=1496506&r2=1496507&view=diff
==============================================================================
--- tika/trunk/tika-core/src/main/java/org/apache/tika/sax/ToXMLContentHandler.java (original)
+++ tika/trunk/tika-core/src/main/java/org/apache/tika/sax/ToXMLContentHandler.java Tue Jun 25 15:00:22 2013
@@ -182,6 +182,10 @@ public class ToXMLContentHandler extends
         }
 
         namespaces.clear();
+        
+        // Reset the position in the tree, to avoid endless stack overflow
+        // chains (see TIKA-1070)
+        currentElement = currentElement.parent;
     }
 
     @Override