Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolved nil pointer dereference #27

Merged
merged 4 commits into from
Sep 20, 2024
Merged

Resolved nil pointer dereference #27

merged 4 commits into from
Sep 20, 2024

Conversation

mr-pmillz
Copy link

Details

This resolves a nil pointer dereference error in cmd/utils.go.

Stack Trace

❯ ./sj endpoints -f yml -l EXAMPLE.yml

INFO[0000] Gathering endpoints.


panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x7e5032]

goroutine 1 [running]:
github.com/BishopFox/sj/cmd.SwaggerRequest.AddParametersToRequest({{0x0, 0x0}, {0x0, 0x0}, 0x0, {0x0, 0x0}, 0xc00019b140, {0x0, 0x0, ...}, ...}, ...)
        /root/repos/sj/cmd/utils.go:321 +0x612
github.com/BishopFox/sj/cmd.SwaggerRequest.BuildDefinedRequests({{0x0, 0x0}, {0x0, 0x0}, 0x0, {0x0, 0x0}, 0xc00019b140, {0x0, 0x0, ...}, ...}, ...)
        /root/repos/sj/cmd/utils.go:182 +0x1e5
github.com/BishopFox/sj/cmd.SwaggerRequest.IterateOverPaths({{0x0, 0x0}, {0x0, 0x0}, 0x0, {0x0, 0x0}, 0x0, {0x0, 0x0, ...}, ...}, ...)
        /root/repos/sj/cmd/utils.go:164 +0x629
github.com/BishopFox/sj/cmd.GenerateRequests({0xc000172000?, 0xc0000ba250?, 0x0?}, {{0x96aac0, 0xc0000feb40}, 0x8f4188, {0x0, 0x0}, 0x0})
        /root/repos/sj/cmd/utils.go:106 +0x4fe
github.com/BishopFox/sj/cmd.init.func5(0xc000120a00?, {0x8ac4ed?, 0x4?, 0x8ac4f1?})
        /root/repos/sj/cmd/endpoints.go:36 +0x285
github.com/spf13/cobra.(*Command).execute(0xc20140, {0xc0000aa880, 0x4, 0x4})
        /root/go/pkg/mod/github.com/spf13/[email protected]/command.go:920 +0x867
github.com/spf13/cobra.(*Command).ExecuteC(0xc1fb80)
        /root/go/pkg/mod/github.com/spf13/[email protected]/command.go:1044 +0x3a5
github.com/spf13/cobra.(*Command).Execute(...)
        /root/go/pkg/mod/github.com/spf13/[email protected]/command.go:968
github.com/BishopFox/sj/cmd.Execute()
        /root/repos/sj/cmd/root.go:55 +0x1a
main.main()
        /root/repos/sj/main.go:6 +0xf

@twest-bf twest-bf self-assigned this Sep 17, 2024
@twest-bf twest-bf added the bug Something isn't working label Sep 17, 2024
Copy link
Collaborator

@twest-bf twest-bf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@twest-bf twest-bf merged commit 31e2862 into BishopFox:main Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants