Browse Source

Fixed one byte stack overflow in mcast recvfrom.

The actual overflow happens when enforcing the NULL termination shortly
after the recvfrom.
nfactor-troky
Tim Bateman 11 years ago committed by Noel Maersk
parent
commit
0a187bdd41
  1. 2
      api.c

2
api.c

@ -3564,7 +3564,7 @@ static void mcast() @@ -3564,7 +3564,7 @@ static void mcast()
count++;
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))) {
applog(LOG_DEBUG, "API mcast failed count=%d (%s) (%d)",
count, SOCKERRMSG, (int)mcast_sock);

Loading…
Cancel
Save