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

Fix a few issues around single-file add argument parsing

Triggered by CID 33630: Unbounded source buffer
parent 4d4059e1
Branches
Tags
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -729,13 +729,13 @@ int main(int argc, char **argv)
SAFECOPY(fdesc, "no description given");
}
sprintf(str,"%s%s", scfg.dir[dirnum]->path, fname);
SAFEPRINTF2(str,"%s%s", scfg.dir[dirnum]->path, fname);
if(mode&FILE_DATE)
sprintf(fdesc, "%s ", unixtodstr(&scfg,(time32_t)fdate(str),tmp));
if(mode&TODAYS_DATE)
sprintf(fdesc, "%s ", unixtodstr(&scfg,time32(NULL),tmp));
sprintf(tmp, "%.*s", (int)(LEN_FDESC-strlen(fdesc)), argv[++j]);
SAFECOPY(fdesc, tmp);
SAFEPRINTF(fdesc, "%s ", unixtodstr(&scfg,(time32_t)fdate(str),tmp));
else if(mode&TODAYS_DATE)
SAFEPRINTF(fdesc, "%s ", unixtodstr(&scfg,time32(NULL),tmp));
j++;
SAFECAT(fdesc, argv[j]);
l=(long)flength(str);
if(l==-1) {
printf("%s not found.\n",str);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment