This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.
Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Hi! xdr_long and xdr_u_long silently discard upper bits on 64bit arches, they should fail instead. 2001-01-03 Jakub Jelinek <jakub@redhat.com> * sunrpc/xdr.c (xdr_long, xdr_u_long): Return FALSE if trying to encode value which does not fit in the 32bit type. --- libc/sunrpc/xdr.c.jj Sat Jul 15 18:45:26 2000 +++ libc/sunrpc/xdr.c Wed Jan 3 12:31:41 2001 @@ -159,7 +159,9 @@ bool_t xdr_long (XDR *xdrs, long *lp) { - if (xdrs->x_op == XDR_ENCODE) + if (xdrs->x_op == XDR_ENCODE + && (sizeof (int32_t) == sizeof (long) + || (int32_t) *lp == *lp)) return XDR_PUTLONG (xdrs, lp); if (xdrs->x_op == XDR_DECODE) @@ -192,6 +194,10 @@ xdr_u_long (XDR *xdrs, u_long *ulp) } case XDR_ENCODE: + if (sizeof (uint32_t) != sizeof (u_long) + && (uint32_t) *ulp != *ulp) + return FALSE; + return XDR_PUTLONG (xdrs, (long *) ulp); case XDR_FREE: Jakub
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |