Commit 7a728e05 authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

Fix CID 33628: Unbounded source buffer

parent 5312e43c
......@@ -3458,7 +3458,7 @@ int main(int argc, char **argv)
puts(usage);
bail(1); }
else
sprintf(src,"%.*s",(int)(sizeof(src)-5),argv[i]); /* leave room for '.src' to be appended */
SAFECOPY(src, argv[i]);
if(show_banner)
printf(banner,PLATFORM_DESC,revision);
......@@ -3474,12 +3474,12 @@ int main(int argc, char **argv)
*p=0; /* Truncate off the src filename */
}
if(getfext(src)==NULL)
strcat(src,".src");
SAFECAT(src,".src");
SAFECOPY(bin_file,src);
if((p=getfext(bin_file))!=NULL)
*p=0;
strcat(bin_file,".bin");
SAFECAT(bin_file,".bin");
if(output_dir[0]) {
p=getfname(bin_file);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment