Skip to contentSkip to conversation

grub_read_file with len==0

DISCUSSION Hollis Blanchard 1 participant 1 message Nov 3, 2006

lore
Share & tools
lore
#0 lore raw

grub_read_file() has this in it:

        if (len == 0 || len > file->size - file->offset)
        	len = file->size - file->offset;

This is a curious divergence from read(2), and bit me when loading an ELF segment with 0 p_filesz but non-0 p_memsz.

Could we remove it? Why is it there in the first place?

-Hollis