Make sure the the value is unsigned before we OR it into the uint64_t
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Sun, 20 Oct 2013 19:41:56 +0000 (12:41 -0700)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Sun, 20 Oct 2013 19:41:56 +0000 (12:41 -0700)
or else the sign might be extended.

lib/libnfs-zdr.c

index 5f7964837a510fffea8f3cc9b0623c8244b8b024..21cd9e13fe5de2ca0c3f00aa3cf8399b9780b800 100644 (file)
@@ -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;