The branch, master has been updated via e2aec9d... s4:registry - "patchfile_preg.c" - fix the read operation of the data length on big-endian platforms via 2164ba5... s4:registry - "patchfile_preg.c" - use "sizeof(uint32_t)" for some size specifications from 479fd9c... s4-net: Simplify SamDB connect code.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit e2aec9d81f53ae80bc7561fa83e88df668998a1a Author: Matthias Dieter Wallnöfer <mwallnoe...@yahoo.de> Date: Thu Apr 8 12:25:34 2010 +0200 s4:registry - "patchfile_preg.c" - fix the read operation of the data length on big-endian platforms commit 2164ba51e299dd2f2829620d5616cd04a0a837f4 Author: Matthias Dieter Wallnöfer <mwallnoe...@yahoo.de> Date: Thu Apr 8 12:20:51 2010 +0200 s4:registry - "patchfile_preg.c" - use "sizeof(uint32_t)" for some size specifications Looks nicer. ----------------------------------------------------------------------- Summary of changes: source4/lib/registry/patchfile_preg.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/source4/lib/registry/patchfile_preg.c b/source4/lib/registry/patchfile_preg.c index c75b08d..c68fb98 100644 --- a/source4/lib/registry/patchfile_preg.c +++ b/source4/lib/registry/patchfile_preg.c @@ -120,7 +120,7 @@ static WERROR reg_preg_diff_del_value(void *_data, const char *key_name, blob.data = (uint8_t *)talloc(data->ctx, uint32_t); W_ERROR_HAVE_NO_MEMORY(blob.data); SIVAL(blob.data, 0, 0); - blob.length = 4; + blob.length = sizeof(uint32_t); werr = reg_preg_diff_set_value(data, key_name, val, REG_DWORD, blob); @@ -139,7 +139,7 @@ static WERROR reg_preg_diff_del_all_values(void *_data, const char *key_name) blob.data = (uint8_t *)talloc(data->ctx, uint32_t); W_ERROR_HAVE_NO_MEMORY(blob.data); SIVAL(blob.data, 0, 0); - blob.length = 4; + blob.length = sizeof(uint32_t); werr = reg_preg_diff_set_value(data, key_name, "**DelVals.", REG_DWORD, blob); @@ -291,12 +291,15 @@ _PUBLIC_ WERROR reg_preg_diff_load(int fd, ret = WERR_GENERAL_FAILURE; goto cleanup; } + /* Get data length */ if (read(fd, &length, 4) < 4) { DEBUG(0, ("Error while reading PReg\n")); ret = WERR_GENERAL_FAILURE; goto cleanup; } + length = IVAL(&length, 0); + /* Read past delimiter */ buf_ptr = buf; if (!(W_ERROR_IS_OK(preg_read_utf16(fd, buf_ptr)) && @@ -305,6 +308,7 @@ _PUBLIC_ WERROR reg_preg_diff_load(int fd, ret = WERR_GENERAL_FAILURE; goto cleanup; } + /* Get the data */ buf_ptr = buf; if (length < buf_size && -- Samba Shared Repository