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:
Robert Watson 2004-08-24 04:59:26 +00:00
parent b7e25836d0
commit cf03a9be9c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=134238

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);