Giter Site home page Giter Site logo

panic: index out of range about gokart HOT 6 CLOSED

azdagron avatar azdagron commented on May 18, 2024 1
panic: index out of range

from gokart.

Comments (6)

azdagron avatar azdagron commented on May 18, 2024 1

Seems to be fixed!

$ gokart scan
Using config found at /Users/azdagron/.gokart/analyzers.yml

Revving engines VRMMM VRMMM
3...2...1...Go!

Race Complete! Analysis took 9.036793335s and 2961 Go files were scanned (including imported packages)
GoKart found 0 potentially vulnerable functions

from gokart.

isp1r0 avatar isp1r0 commented on May 18, 2024

Thanks @azdagron - I reproduced the bug here and it should be a small fix.

Can you verify that it works as expected if you run without the path '.' argument?

gokart scan

Or from outside the current directory?

gokart scan spire/

from gokart.

azdagron avatar azdagron commented on May 18, 2024

Panic exists in both of those situations.

$ gokart scan spire
Using default analyzers config found at "~/.gokart/analyzers.yml".

Revving engines VRMMM VRMMM
3...2...1...Go!
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/praetorian-inc/gokart/util.OutputFinding(0xc000a2ab70, 0x2f, 0xc0040ea900, 0x7a, 0xc0022c5680, 0x4a, 0x48, 0xc000a2aba0, 0x28, 0x0, ...)
	/redacted/go/pkg/mod/github.com/praetorian-inc/[email protected]/util/finding.go:54 +0x116f
github.com/praetorian-inc/gokart/analyzers.Scan(0xc000119f80, 0x1, 0x1)
	/redacted/go/pkg/mod/github.com/praetorian-inc/[email protected]/analyzers/scan.go:128 +0x5bd
github.com/praetorian-inc/gokart/cmd.glob..func1(0x16dcd00, 0xc000119f80, 0x1, 0x1)
	/redacted/go/pkg/mod/github.com/praetorian-inc/[email protected]/cmd/scan.go:53 +0x1ca
github.com/spf13/cobra.(*Command).execute(0x16dcd00, 0xc000119f50, 0x1, 0x1, 0x16dcd00, 0xc000119f50)
	/redacted/go/pkg/mod/github.com/spf13/[email protected]/command.go:860 +0x2c2
github.com/spf13/cobra.(*Command).ExecuteC(0x16dca80, 0xc000000180, 0xc00016df78, 0x1006a25)
	/redacted/go/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
	/redacted/go/pkg/mod/github.com/spf13/[email protected]/command.go:902
github.com/praetorian-inc/gokart/cmd.Execute(...)
	/redacted/go/pkg/mod/github.com/praetorian-inc/[email protected]/cmd/root.go:61
main.main()
	/redacted/go/pkg/mod/github.com/praetorian-inc/[email protected]/main.go:38 +0x32
$ cd spire
$ gokart scan
Using default analyzers config found at "~/.gokart/analyzers.yml".

Revving engines VRMMM VRMMM
3...2...1...Go!
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/praetorian-inc/gokart/util.OutputFinding(0xc002195350, 0x2f, 0xc001363700, 0x7a, 0xc00239d680, 0x4a, 0x48, 0xc002195380, 0x28, 0x0, ...)
	/redacted/go/pkg/mod/github.com/praetorian-inc/[email protected]/util/finding.go:54 +0x116f
github.com/praetorian-inc/gokart/analyzers.Scan(0xc0001122c0, 0x1, 0x1)
	/redacted/go/pkg/mod/github.com/praetorian-inc/[email protected]/analyzers/scan.go:128 +0x5bd
github.com/praetorian-inc/gokart/cmd.glob..func1(0x16dcd00, 0xc0001122c0, 0x1, 0x1)
	/redacted/go/pkg/mod/github.com/praetorian-inc/[email protected]/cmd/scan.go:53 +0x1ca
github.com/spf13/cobra.(*Command).execute(0x16dcd00, 0x170f698, 0x0, 0x0, 0x16dcd00, 0x170f698)
	/redacted/go/pkg/mod/github.com/spf13/[email protected]/command.go:860 +0x2c2
github.com/spf13/cobra.(*Command).ExecuteC(0x16dca80, 0xc000000180, 0xc0001e5f78, 0x1006a25)
	/redacted/go/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
	/redacted/go/pkg/mod/github.com/spf13/[email protected]/command.go:902
github.com/praetorian-inc/gokart/cmd.Execute(...)
	/redacted/go/pkg/mod/github.com/praetorian-inc/[email protected]/cmd/root.go:61
main.main()
	/redacted/go/pkg/mod/github.com/praetorian-inc/[email protected]/main.go:38 +0x32

from gokart.

michaelweber avatar michaelweber commented on May 18, 2024

This should now be fixed in main via #5 - can you confirm this works?

from gokart.

azdagron avatar azdagron commented on May 18, 2024

Happy to!

from gokart.

michaelweber avatar michaelweber commented on May 18, 2024

Excellent! Closing out this issue, we'll cut a bugfix release for this as well.

Cheers!
Mike

from gokart.

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.