diff options
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/registry/patchfile_preg.c | 4 |
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 && |