X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=lib%2Flibnfs-zdr.c;h=f5e1a11270291e191d526ce1703e1018061f2567;hb=b554c8e8d25e51f2c667ceac668dcc3898797e9c;hp=5f7964837a510fffea8f3cc9b0623c8244b8b024;hpb=7e66b2894704187c0497398ffdff12b1de0679e5;p=deb_libnfs.git diff --git a/lib/libnfs-zdr.c b/lib/libnfs-zdr.c index 5f79648..f5e1a11 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; @@ -476,10 +476,12 @@ struct AUTH *libnfs_authunix_create(char *host, uint32_t uid, uint32_t gid, uint size = 4 + 4 + ((strlen(host) + 3) & ~3) + 4 + 4 + 4 + len * 4; auth = malloc(sizeof(struct AUTH)); + memset(auth, 0x00, sizeof(struct AUTH)); auth->ah_cred.oa_flavor = AUTH_UNIX; auth->ah_cred.oa_length = size; auth->ah_cred.oa_base = malloc(size); + memset(auth->ah_cred.oa_base, 0x00, size); buf = (uint32_t *)auth->ah_cred.oa_base; idx = 0; buf[idx++] = htonl(time(NULL));