Giter Club home page Giter Club logo

Comments (3)

UmanShahzad avatar UmanShahzad commented on August 24, 2024 1

The fix for the ipv6 case is live now on grepip version 1.2.1 and ipinfo 2.4.1.

from cli.

T145 avatar T145 commented on August 24, 2024

Error log:

panic: runtime error: index out of range [3] with length 0

goroutine 1 [running]:
encoding/binary.bigEndian.Uint32(...)
	/usr/lib/go-1.17/src/encoding/binary/binary.go:112
github.com/ipinfo/cli/lib.IPFromStdIP({0x0, 0xc00001e160, 0x82784c})
	/go/pkg/mod/github.com/ipinfo/[email protected]/lib/ip.go:24 +0x45
github.com/ipinfo/cli/lib.CmdGrepIP.func1({0x7ffffd27babe, 0x13}, {0x82d580, 0xc000010550})
	/go/pkg/mod/github.com/ipinfo/[email protected]/lib/cmd_grepip.go:265 +0x766
github.com/ipinfo/cli/lib.CmdGrepIP.func2({0x7ffffd27babe, 0x13})
	/go/pkg/mod/github.com/ipinfo/[email protected]/lib/cmd_grepip.go:326 +0x5f
github.com/ipinfo/cli/lib.CmdGrepIP({0x1, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x1}, {0xc0000719f0, 0x1, ...}, ...)
	/go/pkg/mod/github.com/ipinfo/[email protected]/lib/cmd_grepip.go:343 +0x8a2
main.cmdGrepIP()
	/go/pkg/mod/github.com/ipinfo/[email protected]/ipinfo/cmd_grepip.go:65 +0x105
main.main()
	/go/pkg/mod/github.com/ipinfo/[email protected]/ipinfo/main.go:55 +0x1ef

from cli.

UmanShahzad avatar UmanShahzad commented on August 24, 2024

The currrent ipv6 regex seems to have issues properly parsing compressed IPv6 forms where the compression happens in the middle (but works fine if in the start or end). But after some testing it turns out the issue is not with the regex itself but that we were not using the POSIX version of the regex parser. Using that fixes things.

However the error log you shared doesn't happen for me when run against the input IPs shown above even without the fix. It seems to happen for IPv4 cases only, and also seems to be a replica of #62 but not sure how that's possible as the regex is pretty solid now.

If you could help me find an exact input that caused that error, it should be an easy fix.

from cli.

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.