From 8b81dc8c0d765f508064c9c0fc415d91635af947 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 5 Sep 2024 16:19:16 +0800 Subject: [PATCH] 1 --- server/gameserver/ability.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/gameserver/ability.cc b/server/gameserver/ability.cc index 0aee0d42..c016bfa2 100644 --- a/server/gameserver/ability.cc +++ b/server/gameserver/ability.cc @@ -564,6 +564,9 @@ bool Ability::HasDecAttr(int attr_id) void Ability::SetSource(AttrHandle handle, int source_type, std::shared_ptr> cb) { + if (source_type < kAstNone || source_type >= kAstEnd) { + A8_ABORT(); + } auto p = handle.lock(); p->source_type = source_type; p->get_source = cb;