]> granicus.if.org Git - libtirpc/commitdiff
Fix for taddr2addr conversion bug of local addresses
authorOlaf Kirch <okir@suse.de>
Tue, 16 Sep 2008 12:46:29 +0000 (08:46 -0400)
committerSteve Dickson <steved@redhat.com>
Tue, 16 Sep 2008 12:46:29 +0000 (08:46 -0400)
When converting af_local socket addresses in taddr2uaddr, an incorrect
sizeof() would result in a truncated path string. As a result,
rpcbind will report the local /var/lib/rpcbind address to clients
as "/v" on a 32bit machine.

Signed-off-by: okir@suse.de
Signed-off-by: Steve Dickson <steved@redhat.com>
src/rpc_generic.c

index ff4ba16792ccfa8d362337b7122b932d589c3472..b436e3aa8919f81f84c9160beb5e99a7bf77deac 100644 (file)
@@ -629,7 +629,7 @@ __rpc_taddr2uaddr_af(int af, const struct netbuf *nbuf)
                /*      if (asprintf(&ret, "%.*s", (int)(sun->sun_len -
                    offsetof(struct sockaddr_un, sun_path)),
                    sun->sun_path) < 0)*/
-               if (asprintf(&ret, "%.*s", (int)(sizeof(sun) -
+               if (asprintf(&ret, "%.*s", (int)(sizeof(*sun) -
                                                 offsetof(struct sockaddr_un, sun_path)),
                             sun->sun_path) < 0)