From 6e7d449495fccb053f3cea8009b7c7c9b38a0a82 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 31 Jan 2022 02:33:06 +0000 Subject: Refuse to set an extension on the wrong type of extensible. --- src/modules/m_cap.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/modules/m_cap.cpp') diff --git a/src/modules/m_cap.cpp b/src/modules/m_cap.cpp index 54db7cd51..07033df2b 100644 --- a/src/modules/m_cap.cpp +++ b/src/modules/m_cap.cpp @@ -329,6 +329,9 @@ std::string Cap::ExtItem::ToInternal(const Extensible* container, void* item) co void Cap::ExtItem::FromInternal(Extensible* container, const std::string& value) noexcept { + if (container->extype != this->extype) + return; + LocalUser* user = IS_LOCAL(static_cast(container)); if (!user) return; // Can't happen -- cgit v1.3.1-10-gc9f91