From 2ea82730aea3c1b435492af29c90ad56186e16cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Sun, 6 Aug 2023 17:07:04 +0200 Subject: [PATCH] Fix client crash with more than `MAX_VOTE_OPTIONS` vote options The server does not allow adding more than `MAX_VOTE_OPTIONS` vote options, so the client will now also refuse to add more options than that. Supersedes #6930. --- src/game/client/components/voting.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/game/client/components/voting.cpp b/src/game/client/components/voting.cpp index 1eebaf264..392b19371 100644 --- a/src/game/client/components/voting.cpp +++ b/src/game/client/components/voting.cpp @@ -148,6 +148,9 @@ CVoting::CVoting() void CVoting::AddOption(const char *pDescription) { + if(m_NumVoteOptions == MAX_VOTE_OPTIONS) + return; + CVoteOptionClient *pOption; if(m_pRecycleFirst) {