mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-26 03:01:11 +00:00
Got_Saycmd: copy message content into intermediate buffer
This prevents modifying the original buffer at the cleanup step as well as potentially writing out of bounds.
This commit is contained in:
parent
df3b26878a
commit
388a72a89b
1 changed files with 3 additions and 2 deletions
|
@ -641,6 +641,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|
|||
SINT8 target;
|
||||
UINT8 flags;
|
||||
const char *dispname;
|
||||
char buf[HU_MAXMSGLEN + 1];
|
||||
char *msg;
|
||||
boolean action = false;
|
||||
char *ptr;
|
||||
|
@ -650,8 +651,8 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|
|||
|
||||
target = READSINT8(*p);
|
||||
flags = READUINT8(*p);
|
||||
msg = (char *)*p;
|
||||
SKIPSTRINGL(*p, HU_MAXMSGLEN + 1);
|
||||
msg = buf;
|
||||
READSTRINGL(*p, msg, HU_MAXMSGLEN + 1);
|
||||
|
||||
if ((cv_mute.value || flags & (HU_CSAY|HU_SERVER_SAY)) && playernum != serverplayer && !(IsPlayerAdmin(playernum)))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue