Skip to content
Snippets Groups Projects
Commit f38adc13 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix NULL pointer dereference in read_post_data()

What took down cvs/sbbs yesterday:
Program terminated with signal SIGSEGV, Segmentation fault.
6203                    session->req.post_data[session->req.post_len]=0;
[Current thread is 1 (Thread 0x7f2b989ff700 (LWP 17031))]
(gdb) print post_len
No symbol "post_len" in current context.
(gdb) print session->req.post_len
$1 = 0
(gdb) print session->req.post_data
$2 = 0x0
parent ff7c73d8
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #2383 passed
......@@ -6200,7 +6200,8 @@ int read_post_data(http_session_t * session)
lprintf(LOG_DEBUG,"%04d !ERROR Browser said they sent %lu bytes, but I got %lu",session->socket, (ulong)s, (ulong)session->req.post_len);
if(session->req.post_len > s)
session->req.post_len = s;
session->req.post_data[session->req.post_len]=0;
if(session->req.post_data != NULL)
session->req.post_data[session->req.post_len]=0;
}
return(TRUE);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment