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

panic #5

Closed
wfdoran opened this issue Jul 30, 2024 · 1 comment
Closed

panic #5

wfdoran opened this issue Jul 30, 2024 · 1 comment

Comments

@wfdoran
Copy link

wfdoran commented Jul 30, 2024

Running demo code results in panic.


.../bluefox/src> ./bluefox -c 127.0.0.1 1234
panic: runtime error: index out of range [4] with length 4

goroutine 1 [running]:
main.main()
	.../bluefox/src/bluefox.go:272 +0x592

@shuban-789
Copy link
Owner

Hi there. It seems the computation which checks for os.Args[4] is happening even when os.Args does not have the payload option. The issue was I did not increase it to the correct os.Args value and used an &&.

In my new fix I nested the strings.Compare and stated os.Args must be greater than 4 to accomodate the payload.

image

This should work now. Thank you for your insights and let me know if you catch any other errors with my code. It seems I did not catch this one as I was too busy implementing the payload feature.

@shuban-789 shuban-789 pinned this issue Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants