-
-
Notifications
You must be signed in to change notification settings - Fork 904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java XmlSaxPushParser raises odd error when buffer overflows #567
Comments
I see. There's a limit of 512. I'll have a look. |
I've given up on using the push parser since it's so utterly broken for jruby for dealing with chunked data. require "nokogiri"
include Nokogiri::XML::SAX
xml = <<-XML
<CreateApplicationVersionResponse xmlns="http://elasticbeanstalk.amazonaws.com/docs/2010-12-01/">
<CreateApplicationVersionResult>
<ApplicationVersion>
<SourceBundle>
<S3Bucket>elasticbeanstalk-us-east-1-516445455037</S3Bucket>
<S3Key>2011-11-14-omega-2a74f431c50ce2d30d72dcc16616aa7596e6f85d.war</S3Key>
</SourceBundle>
<VersionLabel>1.0.0.alpha12</VersionLabel>
<ApplicationName>omega</ApplicationName>
<DateCreated>2011-11-14T20:49:20.332Z</DateCreated>
</ApplicationVersion>
</CreateApplicationVersionResult>
</CreateApplicationVersionResponse>
XML
pusher = PushParser.new(Document.new)
pusher << xml[0,512]
pusher << xml[512,512]
pusher.finish
# ArrayList.java:547:in `RangeCheck': java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
# from ArrayList.java:322:in `get'
# from PushInputStream.java:372:in `put'
# from PushInputStream.java:94:in `write'
# from PushInputStream.java:105:in `writeAndWaitForRead'
# from XmlSaxPushParser.java:124:in `native_write'
# from XmlSaxPushParser$i$2$0$native_write.gen:65535:in `call'
# from CachingCallSite.java:332:in `cacheAndCall'
# from CachingCallSite.java:203:in `call'
# from FCallTwoArgNode.java:38:in `interpret'
# from NewlineNode.java:104:in `interpret'
# from ASTInterpreter.java:75:in `INTERPRET_METHOD'
# from InterpretedMethod.java:190:in `call'
# from DefaultMethod.java:179:in `call'
# from AliasMethod.java:61:in `call'
# from CachingCallSite.java:312:in `cacheAndCall'
# from CachingCallSite.java:169:in `call'
# from ShiftLeftCallSite.java:24:in `call'
# from xml.rb:22:in `__file__'
# from xml.rb:-1:in `load'
# from Ruby.java:693:in `runScript'
# from Ruby.java:686:in `runScript'
# from Ruby.java:593:in `runNormally'
# from Ruby.java:442:in `runFromMain'
# from Main.java:321:in `doRunFromMain'
# from Main.java:241:in `internalRun'
# from Main.java:207:in `run'
# from Main.java:191:in `run'
# from Main.java:171:in `main' |
I'm sorry about push parser. Pure Java version of push parser needs to be improved a lot. There's another bug filed. |
I rewrote and pushed new version of push parser yesterday. This new version doesn't use PushInputStream anymore. |
I'm going to close this issue since I don't get any exception under new push parser. If you, @samuelkadolph, have the same issue on the latest Nokogiri, please reopen the issue. |
When you push a string into the
Nokogiri::XML::Sax::PushParser
that is over 512 characters you get an odd syntax error instead of an error about the buffer overflowing.This works fine with the c version of nokogiri.
https://github.com/tenderlove/nokogiri/blob/v1.5.0/ext/java/nokogiri/internals/PushInputStream.java#L79
The text was updated successfully, but these errors were encountered: