Repository navigation
Labels
Type: BugInconsistencies or issues which will cause an issue or problem for users or implementors.Inconsistencies or issues which will cause an issue or problem for users or implementors.Type: QuestionA query or seeking clarification on parts of the spec. Probably doesn't need the attention of all.A query or seeking clarification on parts of the spec. Probably doesn't need the attention of all.
Description
Syntax Used - simplehttpserver -basic-auth root:root -upload -listen 0.0.0.0:3000
Error
Serving /home/r on http://0.0.0.0:3000/
2021/04/17 05:57:29 http: panic serving X.X.X.X:29799: runtime error: invalid memory address or nil pointer dereference
goroutine 6 [running]:
net/http.(*conn).serve.func1(0xc000099040)
/usr/local/go/src/net/http/server.go:1801 +0x147
panic(0x7f5e00, 0xb0c220)
/usr/local/go/src/runtime/panic.go:975 +0x47a
github.com/projectdiscovery/simplehttpserver/pkg/httpserver.(*HTTPServer).basicauthlayer.func1(0x8d72e0, 0xc0000d8810, 0xc0000de400)
/home/r/go/pkg/mod/github.com/projectdiscovery/simplehttpserver@v0.0.2/pkg/httpserver/authlayer.go:12 +0xd7
net/http.HandlerFunc.ServeHTTP(0xc00000eae0, 0x8d72e0, 0xc0000d8810, 0xc0000de400)
/usr/local/go/src/net/http/server.go:2042 +0x44
github.com/projectdiscovery/simplehttpserver/pkg/httpserver.(*HTTPServer).loglayer.func1(0x8d75e0, 0xc0000962a0, 0xc0000de400)
/home/r/go/pkg/mod/github.com/projectdiscovery/simplehttpserver@v0.0.2/pkg/httpserver/loglayer.go:23 +0x109
net/http.HandlerFunc.ServeHTTP(0xc00000eb00, 0x8d75e0, 0xc0000962a0, 0xc0000de400)
/usr/local/go/src/net/http/server.go:2042 +0x44
net/http.serverHandler.ServeHTTP(0xc0000961c0, 0x8d75e0, 0xc0000962a0, 0xc0000de400)
/usr/local/go/src/net/http/server.go:2843 +0xa3
net/http.(*conn).serve(0xc000099040, 0x8d8220, 0xc000068bc0)
/usr/local/go/src/net/http/server.go:1925 +0x8ad
created by net/http.(*Server).Serve
/usr/local/go/src/net/http/server.go:2969 +0x36c
2021/04/17 05:57:59 http: panic serving X.X.X.X:29800: runtime error: invalid memory address or nil pointer dereference
goroutine 18 [running]:
net/http.(*conn).serve.func1(0xc000124000)
/usr/local/go/src/net/http/server.go:1801 +0x147
panic(0x7f5e00, 0xb0c220)
/usr/local/go/src/runtime/panic.go:975 +0x47a
github.com/projectdiscovery/simplehttpserver/pkg/httpserver.(*HTTPServer).basicauthlayer.func1(0x8d72e0, 0xc0001201b0, 0xc000134000)
/home/r/go/pkg/mod/github.com/projectdiscovery/simplehttpserver@v0.0.2/pkg/httpserver/authlayer.go:12 +0xd7
net/http.HandlerFunc.ServeHTTP(0xc00000eae0, 0x8d72e0, 0xc0001201b0, 0xc000134000)
/usr/local/go/src/net/http/server.go:2042 +0x44
github.com/projectdiscovery/simplehttpserver/pkg/httpserver.(*HTTPServer).loglayer.func1(0x8d75e0, 0xc000140000, 0xc000134000)
/home/r/go/pkg/mod/github.com/projectdiscovery/simplehttpserver@v0.0.2/pkg/httpserver/loglayer.go:23 +0x109
net/http.HandlerFunc.ServeHTTP(0xc00000eb00, 0x8d75e0, 0xc000140000, 0xc000134000)
/usr/local/go/src/net/http/server.go:2042 +0x44
net/http.serverHandler.ServeHTTP(0xc0000961c0, 0x8d75e0, 0xc000140000, 0xc000134000)
/usr/local/go/src/net/http/server.go:2843 +0xa3
net/http.(*conn).serve(0xc000124000, 0x8d8220, 0xc00012c000)
/usr/local/go/src/net/http/server.go:1925 +0x8ad
created by net/http.(*Server).Serve
/usr/local/go/src/net/http/server.go:2969 +0x36c
2021/04/17 05:58:00 http: panic serving X.X.X.X:29801: runtime error: invalid memory address or nil pointer dereference
goroutine 8 [running]:
net/http.(*conn).serve.func1(0xc0000990e0)
/usr/local/go/src/net/http/server.go:1801 +0x147
panic(0x7f5e00, 0xb0c220)
/usr/local/go/src/runtime/panic.go:975 +0x47a
github.com/projectdiscovery/simplehttpserver/pkg/httpserver.(*HTTPServer).basicauthlayer.func1(0x8d72e0, 0xc0001202d0, 0xc0000de700)
/home/r/go/pkg/mod/github.com/projectdiscovery/simplehttpserver@v0.0.2/pkg/httpserver/authlayer.go:12 +0xd7
net/http.HandlerFunc.ServeHTTP(0xc00000eae0, 0x8d72e0, 0xc0001202d0, 0xc0000de700)
/usr/local/go/src/net/http/server.go:2042 +0x44
github.com/projectdiscovery/simplehttpserver/pkg/httpserver.(*HTTPServer).loglayer.func1(0x8d75e0, 0xc0001400e0, 0xc0000de700)
/home/r/go/pkg/mod/github.com/projectdiscovery/simplehttpserver@v0.0.2/pkg/httpserver/loglayer.go:23 +0x109
net/http.HandlerFunc.ServeHTTP(0xc00000eb00, 0x8d75e0, 0xc0001400e0, 0xc0000de700)
/usr/local/go/src/net/http/server.go:2042 +0x44
net/http.serverHandler.ServeHTTP(0xc0000961c0, 0x8d75e0, 0xc0001400e0, 0xc0000de700)
/usr/local/go/src/net/http/server.go:2843 +0xa3
net/http.(*conn).serve(0xc0000990e0, 0x8d8220, 0xc000068d40)
/usr/local/go/src/net/http/server.go:1925 +0x8ad
created by net/http.(*Server).Serve
/usr/local/go/src/net/http/server.go:2969 +0x36csimplehttpserver -listen 0.0.0.0:3000 works as expected
Metadata
Metadata
Assignees
Labels
Type: BugInconsistencies or issues which will cause an issue or problem for users or implementors.Inconsistencies or issues which will cause an issue or problem for users or implementors.Type: QuestionA query or seeking clarification on parts of the spec. Probably doesn't need the attention of all.A query or seeking clarification on parts of the spec. Probably doesn't need the attention of all.
Activity
rtcms commentedon Apr 17, 2021
OOPS Github spoiled the formatting
Please check the Error - https://pastebin.com/yKEtg2mB
ehsandeep commentedon Apr 17, 2021
@rtcms
Did you make an additional POST request or any more steps to reproduce this?
rtcms commentedon Apr 17, 2021
Nope I made a GET request (Visit my VPS's IP:3000 URL) - in-fact 3 GET requests for the error to occur three times
I just tried and POST method which also gives me similar error
fixing crash in #27
bing0o commentedon Apr 17, 2021
I have the same problem when I try to upload a file

ehsandeep commentedon Apr 18, 2021
@bing0o @rtcms this crash is now fixed with #29, we also created a new release, just update the to latest version and this should be fixed now.
bing0o commentedon Apr 18, 2021
@ehsandeep thank you, it works now :)
rtcms commentedon Apr 18, 2021
+1