summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/lib/registry/regf.c5
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;
}