Git Product home page Git Product logo

Comments (6)

mlmitch avatar mlmitch commented on June 6, 2024

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.

cowtowncoder avatar cowtowncoder commented on June 6, 2024

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.

mlmitch avatar mlmitch commented on June 6, 2024

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.

cowtowncoder avatar cowtowncoder commented on June 6, 2024

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.

mlmitch avatar mlmitch commented on June 6, 2024

Thanks for fixing. You've been a real pro about the tickets I've submitted.

from jackson-dataformats-binary.

cowtowncoder avatar cowtowncoder commented on June 6, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.