From: Peter Lieven Date: Fri, 20 Dec 2013 14:37:17 +0000 (+0100) Subject: libnfs_zdr_opaque: make valgrind happy X-Git-Tag: upstream/1.9.6^2~163^2~6 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=1f3f0d58534439668f5d7d0a4bfe0d62a8e09ce6;p=deb_libnfs.git libnfs_zdr_opaque: make valgrind happy valgrind complains about unitialized memory Signed-off-by: Peter Lieven --- diff --git a/lib/libnfs-zdr.c b/lib/libnfs-zdr.c index f5e1a11..7539b08 100644 --- a/lib/libnfs-zdr.c +++ b/lib/libnfs-zdr.c @@ -219,6 +219,9 @@ bool_t libnfs_zdr_opaque(ZDR *zdrs, char *objp, uint32_t size) case ZDR_ENCODE: memcpy(&zdrs->buf[zdrs->pos], objp, size); zdrs->pos += size; + if (zdrs->pos & 3) { + memset(&zdrs->buf[zdrs->pos], 0x00, 4 - (zdrs->pos & 3)); + } zdrs->pos = (zdrs->pos + 3) & ~3; return TRUE; case ZDR_DECODE: