This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [Patch] rexec check for sockaddr length


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   `------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]