You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The com.sun.xml.bind.v2.runtime.output.C14nXmlOutput class seems to have an out of bounds error:
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 8 out of bounds for length 8
at com.sun.xml.bind.v2.runtime.output.C14nXmlOutput.attribute(C14nXmlOutput.java:126)
at com.sun.xml.bind.v2.runtime.XMLSerializer.attribute(XMLSerializer.java:416)
at com.sun.xml.bind.v2.runtime.property.AttributeProperty.serializeAttributes(AttributeProperty.java:73)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeAttributes(ClassBeanInfoImpl.java:352)
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:659)
at com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.serializeBody(SingleElementNodeProperty.java:128)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:329)
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:666)
at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.serializeItem(ArrayElementNodeProperty.java:39)
at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.serializeListBody(ArrayElementProperty.java:142)
at com.sun.xml.bind.v2.runtime.property.ArrayERProperty.serializeBody(ArrayERProperty.java:129)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:329)
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsSoleContent(XMLSerializer.java:563)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeRoot(ClassBeanInfoImpl.java:310)
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:464)
at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:298)
at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:226)
at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:110)
This class is used whenever the com.sun.xml.bind.c14n property is set to true and the jaxb.formatted.output property is set to false.
The offending code seems to be the highlighted bit here in com.sun.xml.bind.v2.runtime.output.C14nXmlOutput#attribute(com.sun.xml.bind.v2.runtime.Name, java.lang.String):
@Override
public void attribute(Name name, String value) throws IOException {
if(staticAttributes.length==len) {
// reallocate
int newLen = len*2;
StaticAttribute[] newbuf = new StaticAttribute[newLen];
System.arraycopy(staticAttributes,0,newbuf,0,len);
for(int i=len;i<newLen;i++)
staticAttributes[i] = new StaticAttribute(); <--- This should read newBuf[i] = new StaticAttribute();
staticAttributes = newbuf;
}
staticAttributes[len++].set(name,value);
}
Thoughts? Is there a workaround for getting C14N formatted output without also setting jaxb.formatted.output to true to avoid this problem?
The text was updated successfully, but these errors were encountered:
lukasj
added a commit
to lukasj/jaxb-ri
that referenced
this issue
May 20, 2023
Hi,
The
com.sun.xml.bind.v2.runtime.output.C14nXmlOutput
class seems to have an out of bounds error:This class is used whenever the
com.sun.xml.bind.c14n property
is set totrue
and thejaxb.formatted.output
property is set tofalse
.The offending code seems to be the highlighted bit here in
com.sun.xml.bind.v2.runtime.output.C14nXmlOutput#attribute(com.sun.xml.bind.v2.runtime.Name, java.lang.String)
:Thoughts? Is there a workaround for getting C14N formatted output without also setting
jaxb.formatted.output
totrue
to avoid this problem?The text was updated successfully, but these errors were encountered: