Don't crash on receiving GRANT from a server

This commit is contained in:
Stephen Bennett 2022-11-20 13:32:10 +00:00 committed by Doug Freed
parent ab9f279a1d
commit f26681c735

View file

@ -84,6 +84,12 @@ static int do_grant(struct Client *source_p, struct Client *target_p, const char
int dooper = 0, dodeoper = 0; int dooper = 0, dodeoper = 0;
struct PrivilegeSet *privset = NULL, *old_privset = NULL; struct PrivilegeSet *privset = NULL, *old_privset = NULL;
if (!IsPerson(source_p))
{
/* This can only happen if a broken server sends us nonsense, so ignore it */
return 0;
}
if (!strcasecmp(new_privset, "deoper")) if (!strcasecmp(new_privset, "deoper"))
{ {
if (!IsOper(target_p)) if (!IsOper(target_p))