-
-
Notifications
You must be signed in to change notification settings - Fork 258
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
Random crash with "panic: runtime error: index out of range [1] with length 1" in .(*HttpRequest).Tidy #262
Comments
Have added an if statement to find out what is in first position of array. Will wait for this situation again to get more info... Result: |
What client did you use to send the request which caused panic? |
The error is caused by this line: Line 117 in a2993ac
Here the HTTP request is split in two by an empty line. Line 100 in a2993ac
The RFC 7230 Section 3 describes the HTTP message syntax:
When request does not contain an empty line (CRLF), there is only one element in the list, which makes SpoofDPI panic. The request sent by the client is malformed. Judging from your output, the client also does not include a mandatory
|
Yes, probably it just a bad request, but i think program should not crash anyway... There should be a way to just drop that package and close connection with client (or just ignore). |
Yes. |
Version
0.12.0
Operating System
Debian 12 (Raspberry Pi OS)
How are you running SpoofDPI?
I'm using Raspberry Pi OS (aarch64) based on Debian 12 and start with args:
./spoofdpi -addr 192.168.1.10
Tried to use binaries from release page, and later build by myself with latest golang 1.23.1 - no differences.
Description
Get random crashes with output:
INF 2024-09-29T14:50:58+03:00 [PROXY] created a listener on port 8080
panic: runtime error: index out of range [1] with length 1
goroutine 121257 [running]:
github.com/xvzc/SpoofDPI/packet.(*HttpRequest).Tidy(0x400011ee00)
/home/abradox/src/SpoofDPI/packet/http.go:117 +0x260
github.com/xvzc/SpoofDPI/proxy.(*Proxy).Start.func1()
/home/abradox/src/SpoofDPI/proxy/proxy.go:82 +0x278
created by github.com/xvzc/SpoofDPI/proxy.(*Proxy).Start in goroutine 7
/home/abradox/src/SpoofDPI/proxy/proxy.go:71 +0x59c
The text was updated successfully, but these errors were encountered: