From d2db300fe8622ca18eae98b9fa1f753f0a6bfc6d Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Fri, 30 May 2014 11:32:18 +0200 Subject: [PATCH] Fix crash if SASL is enabled and ping-cookie is disabled (neither are the default). Reported by fbi (#4307). --- src/modules/m_nick.c | 2 +- src/modules/m_pingpong.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/m_nick.c b/src/modules/m_nick.c index f04732425..e92155b5e 100644 --- a/src/modules/m_nick.c +++ b/src/modules/m_nick.c @@ -1023,7 +1023,7 @@ DLLFUNC CMD_FUNC(m_nick) } /* This had to be copied here to avoid problems.. */ (void)strcpy(sptr->name, nick); - if (sptr->user && IsNotSpoof(sptr) && !CHECKPROTO(sptr, PROTO_CLICAP)) + if (sptr->user && *sptr->user->username && IsNotSpoof(sptr) && !CHECKPROTO(sptr, PROTO_CLICAP)) { /* ** USER already received, now we have NICK. diff --git a/src/modules/m_pingpong.c b/src/modules/m_pingpong.c index dcd752a4a..d2430ce80 100644 --- a/src/modules/m_pingpong.c +++ b/src/modules/m_pingpong.c @@ -164,7 +164,7 @@ Debug((DEBUG_NOTICE, "NOSPOOF")); sendto_one(sptr, ":IRC!IRC@%s PRIVMSG %s :\1VERSION\1", me.name, sptr->name); - if (sptr->user && sptr->name[0] && !CHECKPROTO(sptr, PROTO_CLICAP)) + if (sptr->user && *sptr->user->username && sptr->name[0] && !CHECKPROTO(sptr, PROTO_CLICAP)) return register_user(cptr, sptr, sptr->name, sptr->user->username, NULL, NULL, NULL); return 0;