summaryrefslogtreecommitdiffstats
path: root/hivex/hivex.c
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2010-01-21 17:07:42 +0000
committerRichard Jones <rjones@redhat.com>2010-01-28 11:25:31 +0000
commit64fa7b9db7bd8bd543c2afa413ffbcc488988eab (patch)
tree936dd0647f748717b7daa0fd0dc7102ed42230ba /hivex/hivex.c
parentc052b36385a56df3017b7e75a610add2b2cdea5a (diff)
downloadlibguestfs-64fa7b9db7bd8bd543c2afa413ffbcc488988eab.tar.gz
libguestfs-64fa7b9db7bd8bd543c2afa413ffbcc488988eab.tar.xz
libguestfs-64fa7b9db7bd8bd543c2afa413ffbcc488988eab.zip
hivex: Fix calculation of block size for vk data blocks.
Diffstat (limited to 'hivex/hivex.c')
-rw-r--r--hivex/hivex.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hivex/hivex.c b/hivex/hivex.c
index 81767adb..71d9c29f 100644
--- a/hivex/hivex.c
+++ b/hivex/hivex.c
@@ -1187,7 +1187,7 @@ hivex_value_value (hive_h *h, hive_value_h value,
/* Check that the declared size isn't larger than the block its in. */
size_t blen = block_len (h, data_offset, NULL);
- if (len > blen) {
+ if (len > blen - 4 /* subtract 4 for block header */) {
if (h->msglvl >= 2)
fprintf (stderr, "hivex_value_value: returning EFAULT because data is longer than its block (data 0x%zx, data len %zu, block len %zu)\n",
data_offset, len, blen);