From 3aea4a7601cbc2cbf954fb86cf80b2ab30902099 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 28 May 2016 19:48:52 -0400 Subject: [PATCH] replace strcpy with memmove in D_MD5PasswordPass() --- src/d_netcmd.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 1658d1a6..868469cf 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -2598,11 +2598,13 @@ static void D_MD5PasswordPass(const UINT8 *buffer, size_t len, const char *salt, memset(dest, 0, 16); #else XBOXSTATIC char tmpbuf[256]; + const size_t sl = strlen(salt) - if (len > 256-strlen(salt)) - len = 256-strlen(salt); - memmove(tmpbuf, buffer, len); - strcpy(&tmpbuf[len], salt); + if (len > 256-sl) + len = 256-s;; + memcpy(tmpbuf, buffer, len); + memmove(&tmpbuf[len], salt, sl); + //strcpy(&tmpbuf[len], salt); len += strlen(salt); if (len < 256) memset(&tmpbuf[len],0,256-len);