mirror of
https://github.com/SDL-Hercules-390/hyperion.git
synced 2026-04-16 00:45:27 +02:00
Ensure no strncat overrun
git-svn-id: file:///home/jj/hercules.svn/trunk@1408 956126f8-22a0-4046-8f4a-272fa8102e63
This commit is contained in:
@@ -57,7 +57,7 @@ int html_include(WEBBLK *webblk, char *filename)
|
||||
int ret;
|
||||
|
||||
strncpy(fullname,sysblk.httproot,1024);
|
||||
inclfile = fopen(strncat(fullname,filename,1024),"r");
|
||||
inclfile = fopen(strncat(fullname,filename,sizeof(fullname)-(strlen(fullname)-1)),"r");
|
||||
|
||||
if (!inclfile)
|
||||
{
|
||||
@@ -281,7 +281,7 @@ static void http_verify_path(WEBBLK *webblk, char *path)
|
||||
char resolved_path[1024];
|
||||
int i;
|
||||
|
||||
realpath(sysblk.httproot,resolved_base); strncat(resolved_base,"/",1024);
|
||||
realpath(sysblk.httproot,resolved_base); strncat(resolved_base,"/",sizeof(resolved_base)-(strlen(resolved_path)-1));
|
||||
realpath(path,resolved_path);
|
||||
|
||||
for (i = 0; path[i]; i++)
|
||||
@@ -364,7 +364,7 @@ static void http_download(WEBBLK *webblk, char *filename)
|
||||
CONTYP *mime_type = mime_types;
|
||||
|
||||
strncpy(fullname,sysblk.httproot,1024);
|
||||
strncat(fullname,filename,1024);
|
||||
strncat(fullname,filename,sizeof(fullname)-(strlen(fullname)-1));
|
||||
|
||||
http_verify_path(webblk,fullname);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user