mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'chat-paste-overflow' into 'master'
Fix buffer overflow when pasting into chat See merge request KartKrew/Kart!766
This commit is contained in:
commit
df968e1b1a
1 changed files with 1 additions and 1 deletions
|
|
@ -1251,7 +1251,7 @@ boolean HU_Responder(event_t *ev)
|
|||
if (chatlen+pastelen > HU_MAXMSGLEN)
|
||||
return true; // we can't paste this!!
|
||||
|
||||
memmove(&w_chat[c_input + pastelen], &w_chat[c_input], pastelen);
|
||||
memmove(&w_chat[c_input + pastelen], &w_chat[c_input], (chatlen - c_input) + 1); // +1 for '\0'
|
||||
memcpy(&w_chat[c_input], paste, pastelen); // copy all of that.
|
||||
c_input += pastelen;
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue