Date: Fri, 20 May 2016 06:38:46 +0000 (UTC) From: Don Lewis <truckman@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300273 - stable/10/libexec/ftpd Message-ID: <201605200638.u4K6ckT7085003@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: truckman Date: Fri May 20 06:38:46 2016 New Revision: 300273 URL: https://svnweb.freebsd.org/changeset/base/300273 Log: MFC r299585 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 Modified: stable/10/libexec/ftpd/ftpd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/ftpd/ftpd.c ============================================================================== --- stable/10/libexec/ftpd/ftpd.c Fri May 20 06:35:14 2016 (r300272) +++ stable/10/libexec/ftpd/ftpd.c Fri May 20 06:38:46 2016 (r300273) @@ -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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605200638.u4K6ckT7085003>