You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by "Alex Mantaut (JIRA)" <ji...@apache.org> on 2013/04/04 05:51:15 UTC

[jira] [Commented] (AXIS2C-1628) axiom_node_create_from_buffer modifies the buffer.

    [ https://issues.apache.org/jira/browse/AXIS2C-1628?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13621727#comment-13621727 ] 

Alex Mantaut commented on AXIS2C-1628:
--------------------------------------

It seems that axiom_node_create_from_buffer() goes along carrying the reference to the buffer, and in the call to guththila_token_evaluate_references() the buffer gets modified.
The patch I've created just creates a local copy of the buffer for the reader to use. Other than that the modification of the buffer, the behaviour of the reader seemed correct.
I attach your test case to show how it is fixed... If possible I request the case to be incorporated to the tests...
                
> axiom_node_create_from_buffer modifies the buffer.
> --------------------------------------------------
>
>                 Key: AXIS2C-1628
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-1628
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: guththila
>    Affects Versions: 1.6.0
>         Environment: Linux
>            Reporter: Wes Munsil
>            Priority: Blocker
>         Attachments: axis2c-1628.patch
>
>
> axiom_node_create_from_buffer modifies the buffer. Running this code
>     char * xml =  strdup("<foo>T1 &amp; T2</foo>");
>     AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "before: %s", xml);
>     axiom_node_create_from_buffer(env, xml);
>     AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "after:  %s", xml);
> produces this output:
>     before: <foo>T1 &amp; T2</foo>
>     after:  <foo>T1 & T2; T2</foo>
> In some environments, if the strdup is omitted, a SEGV results, presumably on attempting to modify the string literal.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: c-dev-help@axis.apache.org