[Libguestfs] [PATCH 13/13] hivex: Fix calculation of block size for vk data blocks.

Jim Meyering jim at meyering.net
Thu Jan 28 17:32:47 UTC 2010


Richard W.M. Jones wrote:
> Subject: [PATCH 13/13] hivex: Fix calculation of block size for vk data blocks.
> diff --git a/hivex/hivex.c b/hivex/hivex.c
...
>    /* 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 */) {

I presume there's no symbolic (e.g., sizeof-related) way to get that "4".
ACK.




More information about the Libguestfs mailing list