[
https://issues.apache.org/jira/browse/AXIS2-5125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13101062#comment-13101062
]
Nadeeshani Hewage commented on AXIS2-5125:
------------------------------------------
Hi, i could reproduce the issue using the soapUI by sending a {}, i.e. an empty
json payload, setting the content_type to application/json. Then the indefinite
loop is formed. Alternatively I have attached the client that i used for
reproducing, that sends a null. By setting the necessary messageFormatters and
messageBuilders on the axis2.xml and writing a simple echo service, the issue
reproduces. Will further look into the issue and update the list.
> JSONOMBuilder drives system to an indefinite loop
> -------------------------------------------------
>
> Key: AXIS2-5125
> URL: https://issues.apache.org/jira/browse/AXIS2-5125
> Project: Axis2
> Issue Type: Bug
> Components: json
> Affects Versions: 1.5.5
> Environment: Mac OS X 10.6.8, JVM 1.6.0_26
> Reporter: Han Gun
> Priority: Critical
> Labels: axis2, json
> Attachments: Client.java
>
>
> processDocument method in JSONOMBuilder has the following loop:
> char temp = inputStream.read();
> while (temp != ':') {
> ...
> }
> This will lead to an indefinite loop in case a non-json or empty json {}
> payload is posted to the servlet. Actually any payload without colon
> character ':' should reproduce the same problem.
> I fixed it by changing the variable type temp into int and checking if the
> stream has more elements as a guard condition.
> int temp = inputStream.read();
> while (temp > -1 && temp != ':') {
> if (temp != ' ' && temp != '{') {
> localName += (char)temp;
> }
> temp = inputStream.read();
> }
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]