From e2aec9d81f53ae80bc7561fa83e88df668998a1a Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Thu, 8 Apr 2010 12:25:34 +0200 Subject: s4:registry - "patchfile_preg.c" - fix the read operation of the data length on big-endian platforms --- source4/lib/registry/patchfile_preg.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source4/lib/registry/patchfile_preg.c') 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 && -- cgit