ws-sandesha-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Myles Bunbury (JIRA)" <>
Subject [jira] Created: (AXIS2-4726) Partial Base64Binary data when underlying XML parser does not coalesce text
Date Wed, 26 May 2010 17:28:41 GMT
Partial Base64Binary data when underlying XML parser does not coalesce text

                 Key: AXIS2-4726
             Project: Axis2
          Issue Type: Bug
    Affects Versions: 1.5.1
            Reporter: Myles Bunbury

After running, the following code snippet was produced for Base64Binary.parse(XMLStreamReader):

                                    if (isReaderMTOMAware(reader)
                                        //MTOM aware reader - get the datahandler directly
and put it in the object
                                                (javax.activation.DataHandler) reader.getProperty(;
                                    } else {
                                        if (reader.getEventType() ==
&& reader.getName().equals(new javax.xml.namespace.QName(,
                                            java.lang.String id =,
(( reader).getBuilder()).getDataHandler(id));
                                        } else if(reader.hasText()) {
                                            //Do the usual conversion
                                            java.lang.String content = reader.getText();
//Bug is below

In the last 'else if' block, 'object.setBase64Binary' is called. However, if the XMLStreamReader
is not coalescing, then multiple text nodes can be encountered as this block of code is looped
through via the encapsulating while loop (not shown). With each pass through the loop, old
data is overwritten. The entire text needs to be collected first before calling convertToBase64Binary().

The other branches of the conditional statements are likely vulnerable to the same problem.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message