repositories
/
deb_libnfs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1dc9ea0
)
libnfs_zdr_opaque: make valgrind happy
author
Peter Lieven
<pl@kamp.de>
Fri, 20 Dec 2013 14:37:17 +0000
(15:37 +0100)
committer
Peter Lieven
<pl@kamp.de>
Mon, 23 Dec 2013 11:46:31 +0000
(12:46 +0100)
valgrind complains about unitialized memory
Signed-off-by: Peter Lieven <pl@kamp.de>
lib/libnfs-zdr.c
patch
|
blob
|
blame
|
history
diff --git
a/lib/libnfs-zdr.c
b/lib/libnfs-zdr.c
index f5e1a11270291e191d526ce1703e1018061f2567..7539b08d7ccf7776a3f0f6cc52391e5f760ed62d 100644
(file)
--- 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: