]> granicus.if.org Git - libtirpc/commitdiff
libtirpc: set r_netid and r_owner in __rpcb_findaddr_timed
authorJeff Layton <jlayton@redhat.com>
Fri, 13 Mar 2009 16:44:16 +0000 (12:44 -0400)
committerSteve Dickson <steved@redhat.com>
Fri, 13 Mar 2009 16:44:16 +0000 (12:44 -0400)
These fields in the rpcbind GETADDR call are being passed uninitialized
to CLNT_CALL. In the case of x86_64 at least, this usually leads to a
segfault. On x86, it sometimes causes segfaults and other times causes
garbage to be sent on the wire.

rpcbind generally ignores the r_owner field for calls that come in over
the wire, so it really doesn't matter what we send in that slot. We just
need to send something. The reference implementation from Sun seems to
send a blank string. Have ours follow suit.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
src/rpcb_clnt.c

index ed16f00d523fae641d4700442cd19c7d29cecb21..b1c0038fd0073f060f30898f08a6dba526f5cc98 100644 (file)
@@ -749,6 +749,13 @@ __rpcb_findaddr_timed(program, version, nconf, host, clpp, tp)
        parms.r_addr = NULL;
        parms.r_prog = program;
        parms.r_vers = version;
+       parms.r_netid = nconf->nc_netid;
+
+       /*
+        * According to wire captures, the reference implementation
+        * (OpenSolaris) sends a blank string here too.
+        */
+       parms.r_owner = "";
 
        /*
         * Use default total timeout if no timeout is specified.