Re: svn commit: r299585 - head/libexec/ftpd

2016-05-12 Thread Don Lewis
On 13 May, To: src-committ...@freebsd.org wrote:
> Author: truckman
> Date: Fri May 13 01:52:41 2016
> New Revision: 299585
> URL: https://svnweb.freebsd.org/changeset/base/299585
> 
> Log:
>   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

MFC after:  1 week
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r299585 - head/libexec/ftpd

2016-05-12 Thread Don Lewis
Author: truckman
Date: Fri May 13 01:52:41 2016
New Revision: 299585
URL: https://svnweb.freebsd.org/changeset/base/299585

Log:
  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:
  head/libexec/ftpd/ftpd.c

Modified: head/libexec/ftpd/ftpd.c
==
--- head/libexec/ftpd/ftpd.cFri May 13 01:14:38 2016(r299584)
+++ head/libexec/ftpd/ftpd.cFri May 13 01:52:41 2016(r299585)
@@ -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;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"