Re: [PATCH v2 2/3] pack-bitmap.c: avoid uninitialized `pack_int_id` during reuse

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

 



On Mon, Jun 10, 2024 at 04:10:53PM -0400, Taylor Blau wrote:

> Avoid the uninitialized read by ensuring that the pack_int_id field is
> set in the single-pack reuse case by setting it to either the MIDX
> preferred pack's pack_int_id, or '0', in the case of single-pack
> bitmaps.  In the latter case, we never read the pack_int_id field, so
> the choice of '0' is arbitrary.

Could we set it to some sentinel value for the single-pack case? If we
set it to "-1", then the BUG() added in patch 3 would trigger if we did
accidentally try to feed it to the midx code. Assuming you do not have
2^32-1 packs, of course. ;)

I am OK either way, though. And the rest of the patch looked good.

-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