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
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=101379

View File

@ -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);