Fix obvious NULL pointer dereference from r310350.

This commit is contained in:
Gleb Smirnoff 2017-11-28 19:18:00 +00:00
parent 5cd667e65f
commit 09f876612c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=326338

View File

@ -792,14 +792,13 @@ socklist_recv_sock(struct socklist *sl)
} else {
hname = cvthname(sa);
unmapped(sa);
if (validate(sa, hname) == 0)
hname = NULL;
if (validate(sa, hname) == 0) {
dprintf("Message from %s was ignored.", hname);
return (-1);
}
date = RemoteAddDate ? ADDDATE : 0;
}
if (hname != NULL)
printline(hname, line, date);
else
dprintf("Invalid msg from %s was ignored.", hname);
printline(hname, line, date);
return (0);
}