diff options
author | Wilco Baan Hofman <wilco@baanhofman.nl> | 2009-10-08 12:36:30 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2009-11-15 19:26:50 +0100 |
commit | 45bb24e93914d2fc5253052d75ef7e43a1c2b26c (patch) | |
tree | 0a1644e38c306430966f46674be9b3afb33cf61b /source4/lib | |
parent | 1e984e6630a85686a131a652e83da05bbe36219e (diff) | |
download | samba-45bb24e93914d2fc5253052d75ef7e43a1c2b26c.tar.gz samba-45bb24e93914d2fc5253052d75ef7e43a1c2b26c.tar.bz2 samba-45bb24e93914d2fc5253052d75ef7e43a1c2b26c.zip |
Fix trailing garbage in the hbin block.
This specifically fixes a problem showing extra bytes of garbage in list and
print in regshell, even though the vk.data_length has the correct size.
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/registry/regf.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source4/lib/registry/regf.c b/source4/lib/registry/regf.c index c5a74c7911..a7fed42054 100644 --- a/source4/lib/registry/regf.c +++ b/source4/lib/registry/regf.c @@ -261,6 +261,11 @@ static uint32_t hbin_store (struct regf_data *data, DATA_BLOB blob) memcpy(dest.data, blob.data, blob.length); + /* Make sure that we have no tailing garbage in the block */ + if (dest.length > blob.length) { + memset(dest.data + blob.length, 0, dest.length - blob.length); + } + return ret; } |