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.
This commit is contained in:
Robert Müller 2023-08-06 17:07:04 +02:00
parent 0d5a853197
commit 2ea82730ae

View file

@ -148,6 +148,9 @@ CVoting::CVoting()
void CVoting::AddOption(const char *pDescription) void CVoting::AddOption(const char *pDescription)
{ {
if(m_NumVoteOptions == MAX_VOTE_OPTIONS)
return;
CVoteOptionClient *pOption; CVoteOptionClient *pOption;
if(m_pRecycleFirst) if(m_pRecycleFirst)
{ {