You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@santuario.apache.org by Sean Mullan <Se...@Sun.COM> on 2004/08/17 16:02:54 UTC

Bug/regression in XMLSignatureInput.getNodeSet()

There is a bug in XMLSignatureInput.getNodeSet() - it will throw a 
NullPointerException if the nodeset is empty. This is a regression from the 1_1 
release and causes one of the xpath filter 2 interop test vectors to fail:
merlin-xpath-filter2-three/sign-spec.xml

Here is a simple patch/code diffs:

$ cvs diff -c XMLSignatureInput.java
Index: XMLSignatureInput.java
===================================================================
RCS file: 
/home/cvspublic/xml-security/src/org/apache/xml/security/signature/XMLSignatureInput.java,v
retrieving revision 1.26
diff -c -r1.26 XMLSignatureInput.java
*** XMLSignatureInput.java      12 May 2004 12:00:45 -0000      1.26
--- XMLSignatureInput.java      17 Aug 2004 13:59:44 -0000
***************
*** 250,256 ****
                 return this._inputNodeSet;
           }
         if (this.isNodeSet()) {
! 
XMLUtils.circumventBug2650(XMLUtils.getOwnerDocument(this._inputNodeSet));
            return this._inputNodeSet;
         } else if (this.isOctetStream()) {
            DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
--- 250,258 ----
                 return this._inputNodeSet;
           }
         if (this.isNodeSet()) {
!        if (!this._inputNodeSet.isEmpty()) {
! 
XMLUtils.circumventBug2650(XMLUtils.getOwnerDocument(this._inputNodeSet));
!        }
            return this._inputNodeSet;
         } else if (this.isOctetStream()) {
            DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();


Re: Bug/regression in XMLSignatureInput.getNodeSet()

Posted by Davanum Srinivas <da...@gmail.com>.
fixed.

thanks,
dims

On Tue, 17 Aug 2004 10:02:54 -0400, Sean Mullan <se...@sun.com> wrote:
> There is a bug in XMLSignatureInput.getNodeSet() - it will throw a
> NullPointerException if the nodeset is empty. This is a regression from the 1_1
> release and causes one of the xpath filter 2 interop test vectors to fail:
> merlin-xpath-filter2-three/sign-spec.xml
> 
> Here is a simple patch/code diffs:
> 
> $ cvs diff -c XMLSignatureInput.java
> Index: XMLSignatureInput.java
> ===================================================================
> RCS file:
> /home/cvspublic/xml-security/src/org/apache/xml/security/signature/XMLSignatureInput.java,v
> retrieving revision 1.26
> diff -c -r1.26 XMLSignatureInput.java
> *** XMLSignatureInput.java      12 May 2004 12:00:45 -0000      1.26
> --- XMLSignatureInput.java      17 Aug 2004 13:59:44 -0000
> ***************
> *** 250,256 ****
>                  return this._inputNodeSet;
>            }
>          if (this.isNodeSet()) {
> !
> XMLUtils.circumventBug2650(XMLUtils.getOwnerDocument(this._inputNodeSet));
>             return this._inputNodeSet;
>          } else if (this.isOctetStream()) {
>             DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
> --- 250,258 ----
>                  return this._inputNodeSet;
>            }
>          if (this.isNodeSet()) {
> !        if (!this._inputNodeSet.isEmpty()) {
> !
> XMLUtils.circumventBug2650(XMLUtils.getOwnerDocument(this._inputNodeSet));
> !        }
>             return this._inputNodeSet;
>          } else if (this.isOctetStream()) {
>             DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
> 
> 


-- 
Davanum Srinivas - http://webservices.apache.org/~dims/