diff options
author | Gerald Carter <jerry@samba.org> | 2005-05-26 20:36:04 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:57:00 -0500 |
commit | d5e79de59561e614fce79a9460c3b2caaa459673 (patch) | |
tree | 43c6c7f352ff1c0f9f16808466b47069db3655e7 /source3/registry | |
parent | 45d03e327ae8b2b9b9761ed76161d4467b27f730 (diff) | |
download | samba-d5e79de59561e614fce79a9460c3b2caaa459673.tar.gz samba-d5e79de59561e614fce79a9460c3b2caaa459673.tar.bz2 samba-d5e79de59561e614fce79a9460c3b2caaa459673.zip |
r6995: * fixing segfault when writing out registry values of zero length
* add RegSaveKey() client function
* add 'net rpc registry save' subcommand
(This used to be commit f35e0a0a8d8df5c39e61ebd34c4aecbc5c9bb635)
Diffstat (limited to 'source3/registry')
-rw-r--r-- | source3/registry/regfio.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/registry/regfio.c b/source3/registry/regfio.c index ab6be77f18..6049b9bdd6 100644 --- a/source3/registry/regfio.c +++ b/source3/registry/regfio.c @@ -1653,8 +1653,11 @@ static BOOL create_vk_record( REGF_FILE *file, REGF_VK_REC *vk, REGISTRY_VALUE * vk->data_off = prs_offset( &data_hbin->ps ) + data_hbin->first_hbin_off - HBIN_HDR_SIZE; } else { + /* 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) ); vk->data_size |= VK_DATA_IN_OFFSET; - memcpy( &vk->data_off, regval_data_p(value), sizeof(uint32) ); } return True; |