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
This commit is contained in:
Yaroslav Tykhiy 2002-08-05 14:26:40 +00:00
parent c452fbe11c
commit effa0530c4

View File

@ -516,7 +516,7 @@ cmd
} }
| RNTO check_login_ro SP pathname CRLF | RNTO check_login_ro SP pathname CRLF
{ {
if ($2) { if ($2 && $4 != NULL) {
if (fromname) { if (fromname) {
renamecmd(fromname, $4); renamecmd(fromname, $4);
free(fromname); free(fromname);
@ -525,7 +525,8 @@ cmd
reply(503, "Bad sequence of commands."); reply(503, "Bad sequence of commands.");
} }
} }
free($4); if ($4 != NULL)
free($4);
} }
| ABOR check_login CRLF | ABOR check_login CRLF
{ {
@ -609,7 +610,7 @@ cmd
{ {
char p[64], *q; char p[64], *q;
if ($4) { if ($4 && $6) {
q = MD5File($6, p); q = MD5File($6, p);
if (q != NULL) if (q != NULL)
reply(200, "MD5(%s) = %s", $6, p); reply(200, "MD5(%s) = %s", $6, p);