From c6f01aa3f1cd4c9b59b7739c35e53f03cf4d3cd1 Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Mon, 11 Feb 2019 08:47:51 +0100 Subject: [PATCH] Protect 2 more commands against rogue server to server traffic. --- src/modules/m_cap.c | 5 ++++- src/modules/m_watch.c | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/modules/m_cap.c b/src/modules/m_cap.c index c4a2fe260..6f05ca2fb 100644 --- a/src/modules/m_cap.c +++ b/src/modules/m_cap.c @@ -354,11 +354,14 @@ CMD_FUNC(m_cap) { struct clicap_cmd *cmd; + if (!MyConnect(sptr)) + return 0; + /* CAP is marked as "no fake lag" because we use custom fake lag rules: * Only add a 1 second fake lag penalty if this is the XXth command. * This will speed up connections considerably. */ - if (MyConnect(sptr) && (sptr->local->receiveM > 15)) + if (sptr->local->receiveM > 15) cptr->local->since++; if (DISABLE_CAP) diff --git a/src/modules/m_watch.c b/src/modules/m_watch.c index 6e2f6aac3..60a5f2178 100644 --- a/src/modules/m_watch.c +++ b/src/modules/m_watch.c @@ -99,6 +99,9 @@ CMD_FUNC(m_watch) int awaynotify = 0; int did_l=0, did_s=0; + if (!MyClient(sptr)) + return 0; + if (parc < 2) { /*