From 8a1bffba9b0ebaa037b8ab9922e96f5cb2616e0c Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 10 Jun 2024 11:15:30 +0100 Subject: [PATCH] Fix a crash in ns_cert. --- include/modules.h | 2 +- modules/nickserv/ns_cert.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/modules.h b/include/modules.h index c942cfbc2..7192092ba 100644 --- a/include/modules.h +++ b/include/modules.h @@ -740,7 +740,7 @@ public: * @param The nick * @param pass The password of the newly registered nick */ - virtual void OnNickRegister(User *user, NickAlias *na, const Anope::string &pass) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); } + virtual void OnNickRegister(User *user, NickAlias *na, const Anope::string &pass) ATTR_NOT_NULL(3) { throw NotImplementedException(); } /** Called when a nick is confirmed. This will never be called if registration confirmation is not enabled. * @param user The user confirming the nick diff --git a/modules/nickserv/ns_cert.cpp b/modules/nickserv/ns_cert.cpp index 4a19762f8..a5567b8e8 100644 --- a/modules/nickserv/ns_cert.cpp +++ b/modules/nickserv/ns_cert.cpp @@ -418,7 +418,7 @@ public: void OnNickRegister(User *u, NickAlias *na, const Anope::string &pass) override { - if (!Config->GetModule(this)->Get("automatic", "yes") || u->fingerprint.empty()) + if (!Config->GetModule(this)->Get("automatic", "yes") || !u || u->fingerprint.empty()) return; auto *cl = certs.Require(na->nc);