Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Jan 2011 00:11:09 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r216943 - head/libexec/ftpd
Message-ID:  <201101040011.p040B9Er010633@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101040011.p040B9Er010633>