UDP_Socket: Add missing limit checks for s, for client and broadcast addresses

This commit is contained in:
Monster Iestyn committed 2018-09-03 15:43:36 +01:00
1 parent 6ae78da47e
commit 24aafa6dac
1 file changed
+3 -3
+3 -3
View File
@@ -1044,7 +1044,7 @@ static boolean UDP_Socket(void)
if (gaie == 0)
{
runp = ai;
while (runp != NULL)
while (runp != NULL && s < MAXNETNODES+1)
{
memcpy(&clientaddress[s], runp->ai_addr, runp->ai_addrlen);
s++;
@@ -1064,7 +1064,7 @@ static boolean UDP_Socket(void)
if (gaie == 0)
{
runp = ai;
while (runp != NULL)
while (runp != NULL && s < MAXNETNODES+1)
{
memcpy(&broadcastaddress[s], runp->ai_addr, runp->ai_addrlen);
s++;
@@ -1087,7 +1087,7 @@ static boolean UDP_Socket(void)
if (gaie == 0)
{
runp = ai;
while (runp != NULL)
while (runp != NULL && s < MAXNETNODES+1)
{
memcpy(&broadcastaddress[s], runp->ai_addr, runp->ai_addrlen);
s++;