mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-17 15:27:36 +00:00
Declare line[] in the outermost scope of retrieve() instead of
declaring it in an inner scope and then using it via a pointer in the outer scope. Reported by: Coverity CID: 605895
This commit is contained in:
parent
e402dde82d
commit
8877d1dbe6
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=299585
@ -1671,14 +1671,14 @@ retrieve(char *cmd, char *name)
|
||||
struct stat st;
|
||||
int (*closefunc)(FILE *);
|
||||
time_t start;
|
||||
char line[BUFSIZ];
|
||||
|
||||
if (cmd == 0) {
|
||||
fin = fopen(name, "r"), closefunc = fclose;
|
||||
st.st_size = 0;
|
||||
} else {
|
||||
char line[BUFSIZ];
|
||||
|
||||
(void) snprintf(line, sizeof(line), cmd, name), name = line;
|
||||
(void) snprintf(line, sizeof(line), cmd, name);
|
||||
name = line;
|
||||
fin = ftpd_popen(line, "r"), closefunc = ftpd_pclose;
|
||||
st.st_size = -1;
|
||||
st.st_blksize = BUFSIZ;
|
||||
|
Loading…
Reference in New Issue
Block a user