diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2005-08-20 23:36:43 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:34:14 -0500 |
commit | 7c77a16e408f9c9043ba9520082dbad4559e1957 (patch) | |
tree | 6449d7237f38735bfc97485f96deb61808728893 /source4/librpc/ndr | |
parent | 3c4cc87bf8b7e24664d8402ab09b0f666f7b270f (diff) | |
download | samba-7c77a16e408f9c9043ba9520082dbad4559e1957.tar.gz samba-7c77a16e408f9c9043ba9520082dbad4559e1957.tar.bz2 samba-7c77a16e408f9c9043ba9520082dbad4559e1957.zip |
r9439: Make sure the remainder of the array is always initialized if the buffer is
larger then the string to be pushed.
(This used to be commit 70b52e26f31b00637ed7f90f77ff0b2794dad729)
Diffstat (limited to 'source4/librpc/ndr')
-rw-r--r-- | source4/librpc/ndr/ndr_string.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source4/librpc/ndr/ndr_string.c b/source4/librpc/ndr/ndr_string.c index 50fa887a34..f5f128574d 100644 --- a/source4/librpc/ndr/ndr_string.c +++ b/source4/librpc/ndr/ndr_string.c @@ -650,7 +650,13 @@ NTSTATUS ndr_push_charset(struct ndr_push *ndr, int ndr_flags, const char *var, return ndr_push_error(ndr, NDR_ERR_CHARCNV, "Bad character conversion"); } - ndr->offset += ret; + + /* Make sure the remaining part of the string is filled with zeroes */ + if (ret < (byte_mul*length)) { + memset(ndr->data+ndr->offset+ret, 0, (byte_mul*length)-ret); + } + + ndr->offset += length; return NT_STATUS_OK; } |