Ok. Here's the stacktrace.

Petteri

-----Original Message-----
From: Raul Benito [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 05, 2004 2:40 PM
To: [EMAIL PROTECTED]
Subject: Re: InclusiveNamespaces and StringIndexOutOfBoundsException


Petteri Stenius wrote:

>The CVS HEAD version of xml-security causes a StringIndexOutOfBoundsException in 
>InclusiveNamespaces.java.
>
>Find attached a suggested fix to the InclusiveNamespaces.prefixStr2Set method. The 
>fix simply reverts a breaking change in r1.6 of
>InclusiveNamespaces.java.
>
>Petteri
>
>  
>
>------------------------------------------------------------------------
>
>Index: src/org/apache/xml/security/transforms/params/InclusiveNamespaces.java
>===================================================================
>RCS file: 
>/home/cvspublic/xml-security/src/org/apache/xml/security/transforms/params/InclusiveNamespaces.java,v
>retrieving revision 1.6
>diff -u -r1.6 InclusiveNamespaces.java
>--- src/org/apache/xml/security/transforms/params/InclusiveNamespaces.java     3 Aug 
>2004 18:01:22 -0000       1.6
>+++ src/org/apache/xml/security/transforms/params/InclusiveNamespaces.java     5 Oct 
>2004 08:39:31 -0000
>@@ -151,7 +151,7 @@
>          if (prefix.equals("#default")) {
>             prefixes.add("xmlns" );
>          } else {
>-            prefixes.add( prefix);
>+            prefixes.add("xmlns:" + prefix);
>          }
>       }
> 
>  
>

Thanks for the change,but it is not going to work as the c14n methods 
don't expect xmlns:prefix anymore(just prefix, is faster and you don't 
create garbage on the way). Can you send us the backtrace and the inputs 
so I can take a look more carefully where it fails.

Thanks,

Raul
java.lang.StringIndexOutOfBoundsException: String index out of range: -4
        at java.lang.String.substring(Unknown Source)
        at java.lang.String.substring(Unknown Source)
        at 
org.apache.xml.security.transforms.params.InclusiveNamespaces.<init>(InclusiveNamespaces.java:89)
        at 
org.apache.xml.security.transforms.params.InclusiveNamespaces.<init>(InclusiveNamespaces.java:64)
        at Main.sign(Main.java:77)
        at Main.main(Main.java:40)

Reply via email to