Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed NULL dereference on GLISTENPORT codepath.
  • Loading branch information
icculus committed May 31, 2009
1 parent df382f1 commit 6e344a0
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions nph-offload.c
Expand Up @@ -1716,16 +1716,21 @@ static int serverMainline(int argc, char **argv, char **envp)
char onebyte = 0;
const ssize_t recvval = recv(GSocket, &onebyte, sizeof (onebyte), MSG_DONTWAIT);
deadsocket = (recvval == 0);
if (deadsocket)
debugEcho("EOF on socket!");
if ( ((recvval < 0) && (errno == EAGAIN)) || (deadsocket) )
break;
} // while
#else
if ( (feof(stdout)) || (ferror(stdout)) )
{
debugEcho("EOF or error on stdout!");
deadsocket = 1;
} // if
#endif

if (deadsocket || feof(stdout) || ferror(stdout))
{
debugEcho("EOF on stdout!");
if (deadsocket)
break;
} // if

if ((br >= startRange) && (br < endRange))
{
Expand Down

0 comments on commit 6e344a0

Please sign in to comment.