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:
parent
ccba343195
commit
a52ebd899d
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user