summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2010-04-08 12:25:34 +0200
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2010-04-08 12:27:27 +0200
commite2aec9d81f53ae80bc7561fa83e88df668998a1a (patch)
treec92436fd25c0c2a38dc1b79d8a627f2e152f88da /source4/lib
parent2164ba51e299dd2f2829620d5616cd04a0a837f4 (diff)
downloadsamba-e2aec9d81f53ae80bc7561fa83e88df668998a1a.tar.gz
samba-e2aec9d81f53ae80bc7561fa83e88df668998a1a.tar.bz2
samba-e2aec9d81f53ae80bc7561fa83e88df668998a1a.zip
s4:registry - "patchfile_preg.c" - fix the read operation of the data length on big-endian platforms
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/registry/patchfile_preg.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source4/lib/registry/patchfile_preg.c b/source4/lib/registry/patchfile_preg.c
index 19e60fa9ba..c68fb98a13 100644
--- a/source4/lib/registry/patchfile_preg.c
+++ b/source4/lib/registry/patchfile_preg.c
@@ -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 &&