summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-07-01 08:33:42 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:19:02 -0500
commitcee17efc7c3897182765d457cce98043f7a7b94f (patch)
tree7e4432a92934b142179decd3e6d1b4dc1b61e723
parent5d55ee570beded36f985c907fcf952659557849c (diff)
downloadsamba-cee17efc7c3897182765d457cce98043f7a7b94f.tar.gz
samba-cee17efc7c3897182765d457cce98043f7a7b94f.tar.bz2
samba-cee17efc7c3897182765d457cce98043f7a7b94f.zip
r8045: fix valgrind warning, add zero padding when the string doesn't fill the full FIXLEN
metze (This used to be commit d8175b01db69436d8af64b97d7b7beca4ba4b552)
-rw-r--r--source4/librpc/ndr/ndr_string.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source4/librpc/ndr/ndr_string.c b/source4/librpc/ndr/ndr_string.c
index 134e4b8059..008b58dab9 100644
--- a/source4/librpc/ndr/ndr_string.c
+++ b/source4/librpc/ndr/ndr_string.c
@@ -435,7 +435,11 @@ NTSTATUS ndr_push_string(struct ndr_push *ndr, int ndr_flags, const char *s)
return ndr_push_error(ndr, NDR_ERR_CHARCNV,
"Bad character conversion");
}
- ndr->offset += byte_mul*d_len;
+ ndr->offset += ret;
+ if ((byte_mul*d_len) > ret) {
+ uint32_t _padding_len = (byte_mul*d_len) - ret;
+ NDR_CHECK(ndr_push_zero(ndr, _padding_len));
+ }
break;
default: