1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-09 14:28:12 +00:00

Fixed one byte stack overflow in mcast recvfrom.

The actual overflow happens when enforcing the NULL termination shortly
after the recvfrom.
This commit is contained in:
Tim Bateman 2013-12-03 10:46:32 -05:00 committed by Noel Maersk
parent 65d9136dd5
commit 0a187bdd41

2
api.c
View File

@ -3564,7 +3564,7 @@ static void mcast()
count++; count++;
came_from_siz = sizeof(came_from); came_from_siz = sizeof(came_from);
if (SOCKETFAIL(rep = recvfrom(mcast_sock, buf, sizeof(buf), if (SOCKETFAIL(rep = recvfrom(mcast_sock, buf, sizeof(buf) - 1,
0, (struct sockaddr *)(&came_from), &came_from_siz))) { 0, (struct sockaddr *)(&came_from), &came_from_siz))) {
applog(LOG_DEBUG, "API mcast failed count=%d (%s) (%d)", applog(LOG_DEBUG, "API mcast failed count=%d (%s) (%d)",
count, SOCKERRMSG, (int)mcast_sock); count, SOCKERRMSG, (int)mcast_sock);