From: Ken Raeburn Date: Thu, 31 Oct 2002 23:03:47 +0000 (+0000) Subject: * xdr_alloc.c (xdralloc_putlong): Coerce value pointed to by argument to 32 X-Git-Tag: krb5-1.3-alpha1~299 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=408b5f5e9f195089621695eb494161b4e2cb9fe1;p=krb5.git * xdr_alloc.c (xdralloc_putlong): Coerce value pointed to by argument to 32 bits, rather than reading only 32 bits from the supplied address. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14954 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/rpc/ChangeLog b/src/lib/rpc/ChangeLog index 0626d9d55..2a0f4846d 100644 --- a/src/lib/rpc/ChangeLog +++ b/src/lib/rpc/ChangeLog @@ -1,3 +1,9 @@ +2002-10-31 Ken Raeburn + + * xdr_alloc.c (xdralloc_putlong): Coerce value pointed to by + argument to 32 bits, rather than reading only 32 bits from the + supplied address. + 2002-09-24 Ken Raeburn * Makefile.in ($(HDRS)): Depend on includes. diff --git a/src/lib/rpc/xdr_alloc.c b/src/lib/rpc/xdr_alloc.c index 236377b92..ee83cdec0 100644 --- a/src/lib/rpc/xdr_alloc.c +++ b/src/lib/rpc/xdr_alloc.c @@ -102,8 +102,9 @@ static bool_t xdralloc_putlong(xdrs, lp) register XDR *xdrs; long *lp; { - int l = htonl((rpc_u_int32) *(int *)lp); - + int l = htonl((rpc_u_int32) *lp); /* XXX need bounds checking */ + + /* XXX assumes sizeof(int)==4 */ if (DynInsert((DynObject) xdrs->x_private, DynSize((DynObject) xdrs->x_private), &l, sizeof(int)) != DYN_OK)