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

Use SAFECAT() to address Coverity-reported concerns.

parent 34f671d6
No related branches found
No related tags found
No related merge requests found
...@@ -126,7 +126,7 @@ void sbbs_t::batchmenu() ...@@ -126,7 +126,7 @@ void sbbs_t::batchmenu()
for(i=0;i<cfg.total_prots;i++) for(i=0;i<cfg.total_prots;i++)
if(cfg.prot[i]->bicmd[0] && chk_ar(cfg.prot[i]->ar,&useron,&client)) { if(cfg.prot[i]->bicmd[0] && chk_ar(cfg.prot[i]->ar,&useron,&client)) {
sprintf(tmp,"%c",cfg.prot[i]->mnemonic); sprintf(tmp,"%c",cfg.prot[i]->mnemonic);
strcat(tmp2,tmp); SAFECAT(tmp2,tmp);
} }
ungetkey(useron.prot); ungetkey(useron.prot);
ch=(char)getkeys(tmp2,0); ch=(char)getkeys(tmp2,0);
...@@ -299,7 +299,7 @@ void sbbs_t::batchmenu() ...@@ -299,7 +299,7 @@ void sbbs_t::batchmenu()
for(i=0;i<cfg.total_prots;i++) for(i=0;i<cfg.total_prots;i++)
if(cfg.prot[i]->batulcmd[0] && chk_ar(cfg.prot[i]->ar,&useron,&client)) { if(cfg.prot[i]->batulcmd[0] && chk_ar(cfg.prot[i]->ar,&useron,&client)) {
sprintf(tmp,"%c",cfg.prot[i]->mnemonic); sprintf(tmp,"%c",cfg.prot[i]->mnemonic);
strcat(str,tmp); SAFECAT(str,tmp);
} }
ch=(char)getkeys(str,0); ch=(char)getkeys(str,0);
if(ch==text[YNQP][2]) if(ch==text[YNQP][2])
...@@ -387,7 +387,7 @@ BOOL sbbs_t::start_batch_download() ...@@ -387,7 +387,7 @@ BOOL sbbs_t::start_batch_download()
for(i=0;i<cfg.total_prots;i++) for(i=0;i<cfg.total_prots;i++)
if(cfg.prot[i]->batdlcmd[0] && chk_ar(cfg.prot[i]->ar,&useron,&client)) { if(cfg.prot[i]->batdlcmd[0] && chk_ar(cfg.prot[i]->ar,&useron,&client)) {
sprintf(tmp,"%c",cfg.prot[i]->mnemonic); sprintf(tmp,"%c",cfg.prot[i]->mnemonic);
strcat(str,tmp); SAFECAT(str,tmp);
} }
ungetkey(useron.prot); ungetkey(useron.prot);
ch=(char)getkeys(str,0); ch=(char)getkeys(str,0);
...@@ -509,10 +509,10 @@ bool sbbs_t::create_batchdn_lst(bool native) ...@@ -509,10 +509,10 @@ bool sbbs_t::create_batchdn_lst(bool native)
? cfg.altpath[batdn_alt[i]-1] : cfg.dir[batdn_dir[i]]->path); ? cfg.altpath[batdn_alt[i]-1] : cfg.dir[batdn_dir[i]]->path);
unpadfname(batdn_name[i],fname); unpadfname(batdn_name[i],fname);
strcat(path,fname); SAFECAT(path,fname);
if(native) if(native)
fexistcase(path); fexistcase(path);
strcat(path,crlf); SAFECAT(path,crlf);
write(file,path,strlen(path)); write(file,path,strlen(path));
} }
close(file); close(file);
......
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