[Patch] rexec check for sockaddr length
Ulrich Drepper
drepper@redhat.com
Sun Apr 8 20:52:00 GMT 2001
Thorsten Kukuk <kukuk@suse.de> writes:
> --- inet/rexec.c 2000/10/28 00:28:37 1.17
> +++ inet/rexec.c 2001/04/07 14:47:40
> @@ -117,8 +117,7 @@
> }
> listen(s2, 1);
> sa2len = sizeof (sa2);
> - if (getsockname(s2, (struct sockaddr *)&sa2, &sa2len) < 0 ||
> - sa2len != SA_LEN((struct sockaddr *)&sa2)) {
> + if (getsockname(s2, (struct sockaddr *)&sa2, &sa2len) < 0) {
> perror("getsockname");
> (void) __close(s2);
The only problem which exists here is that errno is not set if "only"
the size differs. The size test itself is correct, it was there in
some form or another forever. I've checked in a patch for that.
--
---------------. ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Red Hat `--' drepper at redhat.com `------------------------
More information about the Libc-hacker
mailing list