From 252a56177035de686946fc36b2443a59f2f333bd Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Thu, 19 Jul 2001 20:59:13 +0000 Subject: [PATCH] * xdr_mem.c: Do not assume that XDR x_private field is char * git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13621 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/rpc/ChangeLog | 2 ++ src/lib/rpc/xdr_mem.c | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/lib/rpc/ChangeLog b/src/lib/rpc/ChangeLog index 92c9c9a07..e2dcd5a3c 100644 --- a/src/lib/rpc/ChangeLog +++ b/src/lib/rpc/ChangeLog @@ -1,5 +1,7 @@ 2001-07-19 Ezra Peisach + * xdr_mem.c: Do not assume that XDR x_private field is char *. + * auth.h: AUTH ah_private structure element changed to void *. * clnt.h: CLIENT cl_private structure element changed to type void *. diff --git a/src/lib/rpc/xdr_mem.c b/src/lib/rpc/xdr_mem.c index 885d724e6..18265da81 100644 --- a/src/lib/rpc/xdr_mem.c +++ b/src/lib/rpc/xdr_mem.c @@ -102,7 +102,7 @@ xdrmem_getlong(xdrs, lp) if ((xdrs->x_handy -= sizeof(rpc_int32)) < 0) return (FALSE); *lp = (long)ntohl(*((rpc_u_int32 *)(xdrs->x_private))); - xdrs->x_private += sizeof(rpc_int32); + xdrs->x_private = (char *)xdrs->x_private + sizeof(rpc_int32); return (TRUE); } @@ -115,7 +115,7 @@ xdrmem_putlong(xdrs, lp) if ((xdrs->x_handy -= sizeof(rpc_int32)) < 0) return (FALSE); *(rpc_int32 *)xdrs->x_private = (rpc_int32)htonl((rpc_u_int32)(*lp)); - xdrs->x_private += sizeof(rpc_int32); + xdrs->x_private = (char *)xdrs->x_private + sizeof(rpc_int32); return (TRUE); } @@ -129,7 +129,7 @@ xdrmem_getbytes(xdrs, addr, len) if ((xdrs->x_handy -= len) < 0) return (FALSE); memmove(addr, xdrs->x_private, len); - xdrs->x_private += len; + xdrs->x_private = (char *)xdrs->x_private + len; return (TRUE); } @@ -143,7 +143,7 @@ xdrmem_putbytes(xdrs, addr, len) if ((xdrs->x_handy -= len) < 0) return (FALSE); memmove(xdrs->x_private, addr, len); - xdrs->x_private += len; + xdrs->x_private = (char *)xdrs->x_private + len; return (TRUE); } @@ -164,7 +164,7 @@ xdrmem_setpos(xdrs, pos) unsigned int pos; { register caddr_t newaddr = xdrs->x_base + pos; - register caddr_t lastaddr = xdrs->x_private + xdrs->x_handy; + register caddr_t lastaddr = (char *) xdrs->x_private + xdrs->x_handy; if ((long)newaddr > (long)lastaddr) return (FALSE); @@ -183,7 +183,7 @@ xdrmem_inline(xdrs, len) if (xdrs->x_handy >= len) { xdrs->x_handy -= len; buf = (rpc_int32 *) xdrs->x_private; - xdrs->x_private += len; + xdrs->x_private = (char *)xdrs->x_private + len; } return (buf); } -- 2.26.2