Comments (6)
It looks like
if (_elementCounts.length <= _elementCountsPtr) { // less than or equal to catch more bad cases
//use _elementCountsPtr for new size to guarantee the array is big enough for this call
_elementCounts = Arrays.copyOf(_elementCounts, _elementCountsPtr+10);
}
if (_elementCountsPtr > 0) { //guard for negative indexes
_elementCounts[_elementCountsPtr++] = _currentRemainingElements;
}
doesn't work quite right. However, just adding the
if (_elementCounts.length == _elementCountsPtr) { // initially, as well as if full
_elementCounts = Arrays.copyOf(_elementCounts, _elementCounts.length+10);
}
guard to the methods I mentioned does the trick.
from jackson-dataformats-binary.
Thank you for reporting this.
The usual version check: is this against 2.8.7 (or 2.9.0.pr1), or some older version?
from jackson-dataformats-binary.
Running with 2.8.6. The snippets of code I copied are from the github repository though (so 2.8.7, or 2.9.0?).
from jackson-dataformats-binary.
Ok, this must be via contribution, and for 2.8. Obvious oversight, not sure how I did not catch it... especially since line 556 has proper handling (second one you suggested). I think it's ok not to check for negative indices given that code handles matching of start/end via states, although if it can become problematic it can definitely be added: these calls are not that numerous.
from jackson-dataformats-binary.
Thanks for fixing. You've been a real pro about the tickets I've submitted.
from jackson-dataformats-binary.
Thank you for submitting them! Should go without saying that these make my work much easier, when there's full info on what is going wrong. And encoding/decoding failures are critical to fix as there's usually no work around.
from jackson-dataformats-binary.
Related Issues (20)
- Avro generation failed with enums containing values with special characters HOT 3
- `IonReader` throws `NullPointerException` for unchecked invalid data
- `SmileParser` throws unexpected IOOBE for corrupt content HOT 1
- `IonParser.getIntValue()` fails or does not handle value overflow checks HOT 1
- CBOR: negative BigInteger values not handled correctly HOT 1
- More methods from `IonReader` could throw an unexpected `AssertionError`
- Unexpected `NullPointerException` thrown from `IonParser::getNumberType()` HOT 1
- `IonFactory.createParser(IonReader)` does not initialize state
- `IonReader.next()` throws NPEs for some invalid content
- Implement `JsonParser.getNumberTypeFP()` for binary backends HOT 1
- `IndexOutOfBoundsException` in `JacksonAvroParserImpl` for invalid input
- `IndexOutOfBoundsException` in `CBORParser` for invalid input
- Unexpected NullPointerException in `CBORParser`
- Unexpected `NullPointerException` in `ProtobufParser.currentName()`
- `ProtobufParser.currentName()` returns wrong value at root level
- Unexpected `ArrayIndexOutOfBoundsException` in `CBORParser` for corrupt String value
- IonReader.newBytes() throwing `NegativeArraySizeException` HOT 1
- `IonReader` throws `AssertionError` for Timestamp value HOT 1
- `IonReader.next()` throws `ArrayIndexOutOfBoundsException` for some corrupt content HOT 4
- Support for `StreamReadConstraints.maxNameLength` validation for CBOR, Smile backends
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jackson-dataformats-binary.