Re: [PATCH] attr: fix msan issue in read_attr_from_index
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 17, 2024, 21:14 UTC
- Message-ID
- <xmqqwmmn46ge.fsf@gitster.g>
- In-Reply-To
- <xmqqcyof5n2t.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 8 quoted lines
> Having said all that ... > >> Make the call to `read_attr_from_buf` conditional on `buf` being >> non-NULL, ensuring that `size` is not read if it's never set. > > ... this makes the logic at the caller crystal clear, so even if > there are suboptimal checker that bothers us with false positives, > the change itself justifies itself, I would say.
Well, "even if there were *no* MSAN or other issues wrt usage of size" was what I wanted to say. Sorry for a noise.
Show 9 quoted lines
>> } else {
>> buf = read_blob_data_from_index(istate, path, &size);
>> - stack = read_attr_from_buf(buf, size, path, flags);
>> + if (buf)
>> + stack = read_attr_from_buf(buf, size, path, flags);
>> }
>> return stack;
>
> Thanks.