X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=hivex%2Fhivex.c;h=71d9c29fed920fe475cc81577d1a6bc443876459;hb=d2d21f3ca639241bbaf9be7f07172925db97c155;hp=81767adbab17a80d652d512b6a63993ea086c140;hpb=8459c511c3650dd64581d0e3a002afd18a621d38;p=hivex.git diff --git a/hivex/hivex.c b/hivex/hivex.c index 81767ad..71d9c29 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);