diff options
author | truckman <truckman@FreeBSD.org> | 2016-05-13 01:52:41 +0000 |
---|---|---|
committer | truckman <truckman@FreeBSD.org> | 2016-05-13 01:52:41 +0000 |
commit | f11b38fe039eb9b42196fe8d5e3bf27b4fcd4304 (patch) | |
tree | 3cf4707851118021db675bb66e24fbd12f2e5f5d /libexec | |
parent | 4aaac88354b5c41e2628d506938daf857219e186 (diff) | |
download | FreeBSD-src-f11b38fe039eb9b42196fe8d5e3bf27b4fcd4304.zip FreeBSD-src-f11b38fe039eb9b42196fe8d5e3bf27b4fcd4304.tar.gz |
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
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/ftpd/ftpd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index 8928493..521e152 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -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; |