aboutsummaryrefslogtreecommitdiff
path: root/libexec/ftpd/ftpd.c
diff options
context:
space:
mode:
authorDon Lewis <truckman@FreeBSD.org>2016-05-13 01:52:41 +0000
committerDon Lewis <truckman@FreeBSD.org>2016-05-13 01:52:41 +0000
commit8877d1dbe69cabfee8f3b693b96f90b1e964245d (patch)
tree3cf4707851118021db675bb66e24fbd12f2e5f5d /libexec/ftpd/ftpd.c
parente402dde82ddac39d7327d701b059f16f3860d8f3 (diff)
downloadsrc-8877d1dbe69cabfee8f3b693b96f90b1e964245d.tar.gz
src-8877d1dbe69cabfee8f3b693b96f90b1e964245d.zip
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
Notes
Notes: svn path=/head/; revision=299585
Diffstat (limited to 'libexec/ftpd/ftpd.c')
-rw-r--r--libexec/ftpd/ftpd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index 8928493cffdf..521e152320ec 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;