-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix crash because the GET handler sets the bosh_request_parser to nul…
…l. Also fix the case where the user might send malicious XML to the BOSH proxy
- Loading branch information
Showing
2 changed files
with
36 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9921051
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is almost perfect and covers all cases. We can get rid of the random number as well. What we need to add is -
That will cover all the cases.
<body></body></dummy>
- will emit error and set parsedBody to nulll.<body></body><dummy>
- wont be completely parsed and parsedBody will remain null.9921051
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about the case when the parser's internal buffer is buffering some input from before, which is what I am more worried about - since that data can corrupt future requests.
9921051
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That will never happen.. dummy tag has to be closed.. which we close.. the content inside the dummy tag has to be valid.. for it to be closed properly.. closing the dummy tag before will lead to error.. opening another tag will leave it open..
The only case left is the top level CDATA(inside starting element) node.. which we completely ignore..
There arent any other cases left. (I think).
9921051
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it - it seems like you've covered all the interesting cases. I'll push this and let you know. Need help with the parser reset API instead of constructing a new parser on parsing failure.
9921051
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@satyamshekhar Can you verify if this looks okay to you? 3be0223