If the CGI script only prints a newline, the server process crashes #42

Open
opened 2023-08-30 17:43:39 +00:00 by alexlehm · 0 comments

I had a typo in my cgi script so that it would only write a newline as the first line, this causes the server to stop as the status check accesses the first array element of the line.

panic: runtime error: index out of range [0] with length 0

goroutine 11 [running]:
main.handleCGI(0x7ad, 0xc0000181c0, 0x11, 0xc000016120, 0x2c, 0xc000016180, 0x2a, 0xc0000162d0, 0x24, 0xc000016300, ...)
        /home/lehmann/molly-brown/dynamic.go:84 +0x110c
main.handleGeminiRequest(0x73aa60, 0xc00006bc00, 0x7ad, 0xc0000181c0, 0x11, 0xc000016120, 0x2c, 0xc000016180, 0x2a, 0xc0000162d0, ...)
        /home/lehmann/molly-brown/handler.go:143 +0x1418
created by main.launch
        /home/lehmann/molly-brown/launch.go:169 +0x9e8

I had a typo in my cgi script so that it would only write a newline as the first line, this causes the server to stop as the status check accesses the first array element of the line. ``` panic: runtime error: index out of range [0] with length 0 goroutine 11 [running]: main.handleCGI(0x7ad, 0xc0000181c0, 0x11, 0xc000016120, 0x2c, 0xc000016180, 0x2a, 0xc0000162d0, 0x24, 0xc000016300, ...) /home/lehmann/molly-brown/dynamic.go:84 +0x110c main.handleGeminiRequest(0x73aa60, 0xc00006bc00, 0x7ad, 0xc0000181c0, 0x11, 0xc000016120, 0x2c, 0xc000016180, 0x2a, 0xc0000162d0, ...) /home/lehmann/molly-brown/handler.go:143 +0x1418 created by main.launch /home/lehmann/molly-brown/launch.go:169 +0x9e8 ```
Sign in to join this conversation.
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: solderpunk/molly-brown#42
No description provided.