diff options
author | Christian Ambach <ambi@samba.org> | 2014-11-04 23:50:07 +0100 |
---|---|---|
committer | Christian Ambach <ambi@samba.org> | 2014-12-02 22:21:06 +0100 |
commit | 4b41489901b7f1a78ffd479128c3e0d309e53b53 (patch) | |
tree | aaf9508acc426bd568fd52f5fbbf19d808072f14 /source3/registry/regfio.c | |
parent | 217a0189c15761f6c7b24c9d7bfdbccf85de8e1d (diff) | |
download | samba-4b41489901b7f1a78ffd479128c3e0d309e53b53.tar.gz |
s3:registry/regfio fix some valgrind warnings
Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/registry/regfio.c')
-rw-r--r-- | source3/registry/regfio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/registry/regfio.c b/source3/registry/regfio.c index b32bf0314df..e49de2625e5 100644 --- a/source3/registry/regfio.c +++ b/source3/registry/regfio.c @@ -1741,7 +1741,7 @@ static bool create_vk_record(REGF_FILE *file, REGF_VK_REC *vk, /* make sure we don't try to copy from a NULL value pointer */ if ( vk->data_size != 0 ) - memcpy( &vk->data_off, regval_data_p(value), sizeof(uint32) ); + memcpy( &vk->data_off, regval_data_p(value), vk->data_size); vk->data_size |= VK_DATA_IN_OFFSET; } @@ -1806,7 +1806,7 @@ static int hashrec_cmp( REGF_HASH_REC *h1, REGF_HASH_REC *h2 ) REGF_HASH_REC *hash = &parent->subkeys.hashes[parent->subkey_index]; hash->nk_off = prs_offset( &nk->hbin->ps ) + nk->hbin->first_hbin_off - HBIN_HDR_SIZE; - memcpy( hash->keycheck, name, sizeof(uint32) ); + memcpy(hash->keycheck, name, MIN(strlen(name),sizeof(uint32))); hash->fullname = talloc_strdup( file->mem_ctx, name ); parent->subkey_index++; |