Details
Description
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 != '{')
temp = inputStream.read();
}
Attachments
Attachments
Issue Links
- is duplicated by
-
AXIS2-5440 Tomcat using 100% CPU when application/json (JSONMessageFormatter) is used
- Closed