On Tue, 26 Dec 2023 at 12:04, Philippe Mathieu-Daudé <phi...@linaro.org> wrote: > > Hi, > > On 21/12/23 09:08, Anastasia Belova wrote: > > file_size is uint32_t, so j < file_size should be > > uint32_t too. > > file_size is of elf_word type, which is either uint32_t > or uint64_t. > > Your explanation is not very clear... Maybe you want an unsigned type? > In that case, does the following makes your sanitizer happier?
Since file_size is type 'elf_word', the iterator 'j' should be the matching type. In practice nobody is loading 2GB ELF files, so we don't really run into this, but it is a bug. I agree with Philippe that it would be helpful if the commit message: * is clear about the problem it is fixing * describes whether there are any real-world consequences of the issue and how severe (or not) they are thanks -- PMM