Author: emaste
Date: Tue Jan  4 00:11:09 2011
New Revision: 216943
URL: http://svn.freebsd.org/changeset/base/216943

Log:
  Handle failure from ftpd_popen in statfilecmd().
  
  Reviewed by:  attilio
  MFC after:    1 week

Modified:
  head/libexec/ftpd/ftpd.c

Modified: head/libexec/ftpd/ftpd.c
==============================================================================
--- head/libexec/ftpd/ftpd.c    Tue Jan  4 00:10:29 2011        (r216942)
+++ head/libexec/ftpd/ftpd.c    Tue Jan  4 00:11:09 2011        (r216943)
@@ -2350,6 +2350,10 @@ statfilecmd(char *filename)
        code = lstat(filename, &st) == 0 && S_ISDIR(st.st_mode) ? 212 : 213;
        (void)snprintf(line, sizeof(line), _PATH_LS " -lgA %s", filename);
        fin = ftpd_popen(line, "r");
+       if (fin == NULL) {
+               perror_reply(551, filename);
+               return;
+       }
        lreply(code, "Status of %s:", filename);
        atstart = 1;
        while ((c = getc(fin)) != EOF) {
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to