From: Sascha Wildner Date: Mon, 16 Feb 2015 19:12:56 +0000 (+0100) Subject: keyserv(8): Fix sizeof() of a pointer. X-Git-Tag: v4.2.0rc~802 X-Git-Url: https://gitweb.dragonflybsd.org/~tuxillo/dragonfly.git/commitdiff_plain/14781434ad0717f2d5aa5dec62db4b70b1fc4b6f keyserv(8): Fix sizeof() of a pointer. Commit 748a243b13dd295c04c9e06923a801157f6943e5 tried to fix this, but did it wrongly, because xdrproc_t is a function pointer type and the sizeof will still give 8. The correct way is to use keybuf which is the type and has the correct size (aka HEXKEYBYTES). It is done like this in key_set_1_svc_prog() already. --- diff --git a/usr.sbin/keyserv/keyserv.c b/usr.sbin/keyserv/keyserv.c index 8bc0465abd..1f0cd6ad75 100644 --- a/usr.sbin/keyserv/keyserv.c +++ b/usr.sbin/keyserv/keyserv.c @@ -442,7 +442,7 @@ key_get_conv_2_svc_prog(uid_t uid, keybuf arg) if (debugging) fprintf(stderr, "get_conv(%d, %.*s) = ", uid, - (int)sizeof (xdrproc_t), arg); + (int)sizeof (keybuf), arg); res.status = pk_get_conv_key(uid, arg, &res);