mirror of
https://github.com/libretro/libretro-tyrquake.git
synced 2024-11-25 00:49:52 +00:00
[PATCH] Fix incorrect memcpy usage
using memcpy within the same buffer is not safe: replaced such calls in cmd.c, net_dgrm.c and net_loop.c with memmove calls. Signed-off-by: O.Sezer <sezero@users.sourceforge.net> Signed-off-by: Tyrann <tyrann@disenchant.net>
This commit is contained in:
parent
e91ce02db8
commit
86d3942d35
@ -368,7 +368,7 @@ Datagram_GetMessage(qsocket_t *sock)
|
||||
}
|
||||
sock->sendMessageLength -= MAX_DATAGRAM;
|
||||
if (sock->sendMessageLength > 0) {
|
||||
memcpy(sock->sendMessage, sock->sendMessage + MAX_DATAGRAM,
|
||||
memmove(sock->sendMessage, sock->sendMessage + MAX_DATAGRAM,
|
||||
sock->sendMessageLength);
|
||||
sock->sendNext = true;
|
||||
} else {
|
||||
|
@ -150,7 +150,7 @@ Loop_GetMessage(qsocket_t *sock)
|
||||
sock->receiveMessageLength -= length;
|
||||
|
||||
if (sock->receiveMessageLength)
|
||||
memcpy(sock->receiveMessage, &sock->receiveMessage[length],
|
||||
memmove(sock->receiveMessage, &sock->receiveMessage[length],
|
||||
sock->receiveMessageLength);
|
||||
|
||||
if (sock->driverdata && ret == 1)
|
||||
|
@ -196,7 +196,7 @@ Cbuf_Execute(void)
|
||||
else {
|
||||
i++;
|
||||
cmd_text.cursize -= i;
|
||||
memcpy(text, text + i, cmd_text.cursize);
|
||||
memmove(text, text + i, cmd_text.cursize);
|
||||
}
|
||||
|
||||
/* execute the command line */
|
||||
|
Loading…
Reference in New Issue
Block a user