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

Update the previous commit to revert the error_code length to 4, since we can

And use sizeof, not the magic number (again).
parent 920902f3
No related branches found
No related tags found
1 merge request!455Update branch with changes from master
Pipeline #6361 passed
......@@ -1535,7 +1535,7 @@ static off_t sock_sendfile(http_session_t *session,char *path, off_t start, off_
/********************************************************/
static void send_error(http_session_t * session, unsigned line, const char* message)
{
char error_code[5];
char error_code[4];
struct stat sb;
char sbuf[MAX_PATH+1];
char sbuf2[MAX_PATH+1];
......@@ -1548,7 +1548,7 @@ static void send_error(http_session_t * session, unsigned line, const char* mess
,session->socket, session->client.protocol, session->host_ip, message, line, session->req.request_line);
session->req.keep_alive=false;
session->req.send_location=NO_LOCATION;
strlcpy(error_code, message, 4);
strlcpy(error_code, message, sizeof error_code);
SAFECOPY(session->req.status,message);
if(atoi(error_code)<500) {
/*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment