Skip to content
Snippets Groups Projects
Unverified Commit 2e3963fd authored by Hanicef's avatar Hanicef
Browse files

Fix buffer overflow for setcontrol with 2 arguments

parent 3c819384
No related branches found
No related tags found
1 merge request!1954Fix buffer overflow in setcontrol with 2 arguments
......@@ -993,7 +993,7 @@ static void setcontrol(INT32 (*gc)[2])
{
INT32 numctrl;
const char *namectrl;
INT32 keynum, keynum1, keynum2;
INT32 keynum, keynum1, keynum2 = 0;
INT32 player = ((void*)gc == (void*)&gamecontrolbis ? 1 : 0);
boolean nestedoverride = false;
......@@ -1009,6 +1009,7 @@ static void setcontrol(INT32 (*gc)[2])
return;
}
keynum1 = G_KeyNameToNum(COM_Argv(2));
if (COM_Argc() > 3)
keynum2 = G_KeyNameToNum(COM_Argv(3));
keynum = G_FilterKeyByVersion(numctrl, 0, player, &keynum1, &keynum2, &nestedoverride);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment