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

Use safe string formatting to squelch warnings

Attempt to address 2 GCC version 11.2.0 2 warnings reported by Nelgin
‘%s’ directive writing up to 3 bytes into a region of size between 1 and 4097
parent 3ccd8ef8
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #3088 passed
...@@ -1542,12 +1542,12 @@ static void send_error(http_session_t * session, unsigned line, const char* mess ...@@ -1542,12 +1542,12 @@ static void send_error(http_session_t * session, unsigned line, const char* mess
} }
if(!sent_ssjs) { if(!sent_ssjs) {
if(session->req.error_dir) { if(session->req.error_dir) {
sprintf(session->req.physical_path,"%s%s.html",session->req.error_dir,error_code); SAFEPRINTF2(session->req.physical_path,"%s%s.html",session->req.error_dir,error_code);
if(stat(session->req.physical_path,&sb)) if(stat(session->req.physical_path,&sb))
sprintf(session->req.physical_path,"%s%s.html",error_dir,error_code); SAFEPRINTF2(session->req.physical_path,"%s%s.html",error_dir,error_code);
} }
else else
sprintf(session->req.physical_path,"%s%s.html",error_dir,error_code); SAFEPRINTF2(session->req.physical_path,"%s%s.html",error_dir,error_code);
session->req.mime_type=get_mime_type(strrchr(session->req.physical_path,'.')); session->req.mime_type=get_mime_type(strrchr(session->req.physical_path,'.'));
send_headers(session,message,FALSE); send_headers(session,message,FALSE);
if(!stat(session->req.physical_path,&sb)) { if(!stat(session->req.physical_path,&sb)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment