summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authoryar <yar@FreeBSD.org>2002-08-05 14:26:40 +0000
committeryar <yar@FreeBSD.org>2002-08-05 14:26:40 +0000
commit4396de5e383b44a75a878f14bd190aa7afe50b22 (patch)
tree73d88ae581f017b1ebabacf189bce99dfd8e43bb /libexec
parent09fb3e817b683faeae6544e087e61c3db48565d6 (diff)
downloadFreeBSD-src-4396de5e383b44a75a878f14bd190aa7afe50b22.zip
FreeBSD-src-4396de5e383b44a75a878f14bd190aa7afe50b22.tar.gz
Spot places where "pathname" hasn't been checked
for NULL. The "pathname" rule may return NULL on a glob(3) error. Obtained from: OpenBSD MFC after: 1 week
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ftpd/ftpcmd.y7
1 files changed, 4 insertions, 3 deletions
diff --git a/libexec/ftpd/ftpcmd.y b/libexec/ftpd/ftpcmd.y
index 2284f02..0f48140 100644
--- a/libexec/ftpd/ftpcmd.y
+++ b/libexec/ftpd/ftpcmd.y
@@ -516,7 +516,7 @@ cmd
}
| RNTO check_login_ro SP pathname CRLF
{
- if ($2) {
+ if ($2 && $4 != NULL) {
if (fromname) {
renamecmd(fromname, $4);
free(fromname);
@@ -525,7 +525,8 @@ cmd
reply(503, "Bad sequence of commands.");
}
}
- free($4);
+ if ($4 != NULL)
+ free($4);
}
| ABOR check_login CRLF
{
@@ -609,7 +610,7 @@ cmd
{
char p[64], *q;
- if ($4) {
+ if ($4 && $6) {
q = MD5File($6, p);
if (q != NULL)
reply(200, "MD5(%s) = %s", $6, p);
OpenPOWER on IntegriCloud