diff options
author | Don Lewis <truckman@FreeBSD.org> | 2016-05-13 01:52:41 +0000 |
---|---|---|
committer | Don Lewis <truckman@FreeBSD.org> | 2016-05-13 01:52:41 +0000 |
commit | 8877d1dbe69cabfee8f3b693b96f90b1e964245d (patch) | |
tree | 3cf4707851118021db675bb66e24fbd12f2e5f5d /libexec/ftpd/ftpd.c | |
parent | e402dde82ddac39d7327d701b059f16f3860d8f3 (diff) | |
download | src-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.c | 6 |
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; |