From: Ronnie Sahlberg Date: Sun, 20 Oct 2013 19:41:56 +0000 (-0700) Subject: Make sure the the value is unsigned before we OR it into the uint64_t X-Git-Tag: upstream/1.9.6^2~188 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=c81e7d8921eec0830363758b3e2e84effe4a2dcc;p=deb_libnfs.git Make sure the the value is unsigned before we OR it into the uint64_t or else the sign might be extended. --- diff --git a/lib/libnfs-zdr.c b/lib/libnfs-zdr.c index 5f79648..21cd9e1 100644 --- a/lib/libnfs-zdr.c +++ b/lib/libnfs-zdr.c @@ -124,7 +124,7 @@ bool_t libnfs_zdr_u_quad_t(ZDR *zdrs, uint64_t *u) *u = ntohl(*(uint32_t *)&zdrs->buf[zdrs->pos]); zdrs->pos += 4; *u <<= 32; - *u |= ntohl(*(uint32_t *)&zdrs->buf[zdrs->pos]); + *u |= (uint32_t)ntohl(*(uint32_t *)&zdrs->buf[zdrs->pos]); zdrs->pos += 4; return TRUE; break;