Make sure to properly initialize 'size' to sizeof(sin) before passing

it into accept().  Depending on the initial value in memory, it is
otherwise possible to get EINVAL.
This commit is contained in:
rwatson 2004-08-24 04:59:26 +00:00
parent ccba343195
commit a52ebd899d

View File

@ -107,6 +107,7 @@ main(int argc, char *argv[])
}
for (i = 0; i < LOOPS; i++) {
size = sizeof(sin);
if (accept(s, (struct sockaddr *)&sin, &size) != -1) {
fprintf(stderr, "accept succeeded!\n");
exit(-1);