mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-29 19:43:41 +00:00
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
b7e25836d0
commit
cf03a9be9c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=134238
@ -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…
Reference in New Issue
Block a user