axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas Veithen (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (AXIS2-5300) org.apache.axis2.json.AbstractJSONOMBuilder hangs when JSON has wrong format
Date Wed, 02 May 2012 19:42:51 GMT

     [ https://issues.apache.org/jira/browse/AXIS2-5300?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andreas Veithen resolved AXIS2-5300.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.7.0

The code that pokes around in the JSON string in order to extract the name of the element
no longer exists. The code now uses the feature introduced by AXIOM-399 to determine the name.
Therefore this issue is no longer applicable.
                
> org.apache.axis2.json.AbstractJSONOMBuilder hangs when JSON has wrong format
> ----------------------------------------------------------------------------
>
>                 Key: AXIS2-5300
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5300
>             Project: Axis2
>          Issue Type: Bug
>          Components: json
>    Affects Versions: 1.6.2
>         Environment: Apache tomcat 7.0.25
> Ubuntu 64Bit 11.10
>            Reporter: Matthias Gerber
>            Assignee: Andreas Veithen
>             Fix For: 1.7.0
>
>
> org.apache.axis2.json.AbstractJSONOMBuilder hangs when JSON has wrong format:
> Code loping through reader at line 119 and 135 to get localName should check for end
of stream. 
> Otherwise the code cycles for ever if the string to parse does not contain a  ":"
> Code as it is at the moment:
> 118            char temp = (char)reader.read();
> 119            while (temp != ':') {
> 120               if (temp != ' ' && temp != '{' && temp != '\n' &&
temp != '\r' && temp != '\t') {
> 121                    localName += temp;
> 122                }
> 123                temp = (char)reader.read();
> 124            }
> Code as it should be (or something like that):
>                   int t = reader.read();
> 118            char temp = (char)t;
> 119            while (temp != ':' && t >= 0) {
> 120               if (temp != ' ' && temp != '{' && temp != '\n' &&
temp != '\r' && temp != '\t') {
> 121                    localName += temp;
> 122                }
>                      t =  reader.read();
> 123                temp =  (char)t;
> 124            }
> And maybe some error handling if end of stream is reached. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


Mime
View raw message