Re: [PATCH 03/23] pack-bitmap: bounds-check size of cache extension

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Nov 13, 2020 at 04:49:28PM -0500, Taylor Blau wrote:

> Thanks for your patient explanation. This hunk should instead read:
> 
> +       size_t header_size = sizeof(*header) - GIT_MAX_RAWSZ + the_hash_algo->rawsz;
> 
> -       if (index->map_size < sizeof(*header) + the_hash_algo->rawsz)
> +       if (index->map_size < header_size + the_hash_algo->rawsz)
>                 return error("Corrupted bitmap index (missing header data)");
> 
> That error might not necessarily be right (it could say "missing header
> or trailer data"), though. I'm open to if you think it should be
> changed or not.

Yeah, I agree it's misleading. In the idx code path we just say "%s is
too small", which is more accurate.

-Peff



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux