Skip to content
Snippets Groups Projects
Commit e8f806e8 authored by rswindell's avatar rswindell
Browse files

Replace a couple of potentially unsafe sprintf() calls with SAFEPRINTF().

parent 01f35f2d
No related branches found
No related tags found
No related merge requests found
...@@ -1167,7 +1167,7 @@ static int receive_files(char** fname_list, int fnames) ...@@ -1167,7 +1167,7 @@ static int receive_files(char** fname_list, int fnames)
lprintf(LOG_DEBUG,"Incoming filename: %.64s ",fname); lprintf(LOG_DEBUG,"Incoming filename: %.64s ",fname);
if(mode&RECVDIR) if(mode&RECVDIR)
sprintf(str,"%s%s",fname_list[0],getfname(fname)); SAFEPRINTF(str,"%s%s",fname_list[0],getfname(fname));
else { else {
SAFECOPY(str,getfname(fname)); SAFECOPY(str,getfname(fname));
for(i=0;i<fnames;i++) { for(i=0;i<fnames;i++) {
...@@ -1767,7 +1767,7 @@ int main(int argc, char **argv) ...@@ -1767,7 +1767,7 @@ int main(int argc, char **argv)
bail(1); bail(1);
return -1; return -1;
} }
sprintf(str,"%s",argv[i]+1); SAFEPRINTF(str,"%s",argv[i]+1);
if((fp=fopen(str,"r"))==NULL) { if((fp=fopen(str,"r"))==NULL) {
fprintf(statfp,"!Error %d opening filelist: %s\n",errno,str); fprintf(statfp,"!Error %d opening filelist: %s\n",errno,str);
bail(1); bail(1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment