Fix potential index out of bounds

This commit is contained in:
Johan Mattsson 2023-02-25 14:38:44 +01:00 committed by GitHub
parent 4610a2403a
commit 79a81b3e58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2306,7 +2306,7 @@ int BotExpandChatMessage(char *outmessage, char *message, unsigned long mcontext
} //end while
//step over the trailing escape char
if (*msgptr) msgptr++;
if (num > MAX_MATCHVARIABLES)
if (num >= MAX_MATCHVARIABLES)
{
botimport.Print(PRT_ERROR, "BotConstructChat: message %s variable %d out of range\n", message, num);
return qfalse;