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

Fix CID 33628: Unbounded source buffer

parent 5312e43c
Branches
Tags
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -3458,7 +3458,7 @@ int main(int argc, char **argv) ...@@ -3458,7 +3458,7 @@ int main(int argc, char **argv)
puts(usage); puts(usage);
bail(1); } bail(1); }
else else
sprintf(src,"%.*s",(int)(sizeof(src)-5),argv[i]); /* leave room for '.src' to be appended */ SAFECOPY(src, argv[i]);
if(show_banner) if(show_banner)
printf(banner,PLATFORM_DESC,revision); printf(banner,PLATFORM_DESC,revision);
...@@ -3474,12 +3474,12 @@ int main(int argc, char **argv) ...@@ -3474,12 +3474,12 @@ int main(int argc, char **argv)
*p=0; /* Truncate off the src filename */ *p=0; /* Truncate off the src filename */
} }
if(getfext(src)==NULL) if(getfext(src)==NULL)
strcat(src,".src"); SAFECAT(src,".src");
SAFECOPY(bin_file,src); SAFECOPY(bin_file,src);
if((p=getfext(bin_file))!=NULL) if((p=getfext(bin_file))!=NULL)
*p=0; *p=0;
strcat(bin_file,".bin"); SAFECAT(bin_file,".bin");
if(output_dir[0]) { if(output_dir[0]) {
p=getfname(bin_file); p=getfname(bin_file);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment