* xdr_alloc.c (xdralloc_putlong): Coerce value pointed to by argument to 32
authorKen Raeburn <raeburn@mit.edu>
Thu, 31 Oct 2002 23:03:47 +0000 (23:03 +0000)
committerKen Raeburn <raeburn@mit.edu>
Thu, 31 Oct 2002 23:03:47 +0000 (23:03 +0000)
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

src/lib/rpc/ChangeLog
src/lib/rpc/xdr_alloc.c

index 0626d9d55f1c3f39148dc7535e6c4df9082ffc97..2a0f4846dee8ffa9b2dc06bf18a3c298a9531791 100644 (file)
@@ -1,3 +1,9 @@
+2002-10-31  Ken Raeburn  <raeburn@mit.edu>
+
+       * 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  <raeburn@mit.edu>
 
        * Makefile.in ($(HDRS)): Depend on includes.
index 236377b92348e938aba807a8770ca96ac42b4595..ee83cdec01780fa6dec766a1dd722eb580dda26f 100644 (file)
@@ -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)