diff options
author | emaste <emaste@FreeBSD.org> | 2011-01-04 00:11:09 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2011-01-04 00:11:09 +0000 |
commit | a756c46242b975e3eff37d195fd1cddaef36fa11 (patch) | |
tree | 3354412233bb9c81aef5d858ffdfa035de711bb9 /libexec/ftpd/ftpd.c | |
parent | 3e8aab08a5f7893a079cda6d1e65023257ca2b79 (diff) | |
download | FreeBSD-src-a756c46242b975e3eff37d195fd1cddaef36fa11.zip FreeBSD-src-a756c46242b975e3eff37d195fd1cddaef36fa11.tar.gz |
Handle failure from ftpd_popen in statfilecmd().
Reviewed by: attilio
MFC after: 1 week
Diffstat (limited to 'libexec/ftpd/ftpd.c')
-rw-r--r-- | libexec/ftpd/ftpd.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index 78ebc7c..dd9d469 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -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) { |