DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41573>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41573

           Summary: XMLCipher StackOverflowError
           Product: Security
           Version: unspecified
          Platform: PC
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Encryption
        AssignedTo: security-dev@xml.apache.org
        ReportedBy: [EMAIL PROTECTED]


When encrypt xml documents large then 5MB 
using org.apache.xml.security.encryption.XMLCipher 

Exception in thread "main" java.lang.StackOverflowError
>         at org.apache.xerces.dom.ParentNode.internalRemoveChild(Unknown 
> Source)
>         at org.apache.xerces.dom.ParentNode.removeChild(Unknown Source)
>         at org.apache.xml.security.encryption.XMLCipher.removeContent(Unknown 
> So
> urce)
>         at org.apache.xml.security.encryption.XMLCipher.removeContent(Unknown 
> So

then bag is in implementation : (recursive invocation)

    private void removeContent(Node node) {
        NodeList list = node.getChildNodes();
        if (list.getLength() > 0) {
            Node n = list.item(0);
            if (null != n) {
                n.getParentNode().removeChild(n);
            }
            removeContent(node);
        }
    }


I'm sugesting change it, for example:

    private void removeContent(Node node) {
        NodeList list = node.getChildNodes();
        while(list.getLength() > 0) {
            Node n = list.item(0);
            if (null != n) {
                n.getParentNode().removeChild(n);
            }
        }
    }

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Reply via email to