Coder Social home page Coder Social logo

index out of range about d2s HOT 2 CLOSED

nokka avatar nokka commented on June 9, 2024
index out of range

from d2s.

Comments (2)

nokka avatar nokka commented on June 9, 2024

Hey! yeah I think it's because a diablo 2 binary file is at least 767 bytes of data. The header that is, so this string might be too short, and crash the header parser here: https://github.com/nokka/d2s/blob/master/d2s.go#L67.

I'll have a look!

from d2s.

 avatar commented on June 9, 2024

io.ReadFull wouldn't panic if there were less than 767 bytes. And the above program panics here:

d2s/d2s.go

Line 628 in c8f86bc

if itemList[last].TypeID == weapon {

panic: runtime error: index out of range

goroutine 1 [running]:
github.com/nokka/d2s.parseItemList(0x5aa120, 0xc42005a6c0, 0x3030, 0x5dbbc0, 0x4e0880, 0xc420015774, 0x0, 0x0)
        /home/opennota/gocode/src/github.com/nokka/d2s/d2s.go:628 +0x16a3
github.com/nokka/d2s.parseItems(0x5aa120, 0xc42005a6c0, 0xc420010800, 0x0, 0x0)
        /home/opennota/gocode/src/github.com/nokka/d2s/d2s.go:222 +0x233
github.com/nokka/d2s.Parse(0x5aa3e0, 0xc42000a260, 0x1, 0x0, 0x0)
        /home/opennota/gocode/src/github.com/nokka/d2s/d2s.go:34 +0x149
main.main()
        /home/opennota/d2s.go:53 +0x8e

from d2s.

Related Issues (13)

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.