]> git.ozlabs.org Git - petitboot/commitdiff
grub2: fix empty file handling
authorJeremy Kerr <jk@ozlabs.org>
Wed, 4 Jun 2014 07:45:53 +0000 (15:45 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Thu, 5 Jun 2014 07:25:10 +0000 (15:25 +0800)
Currently, we have a bug when parsing zero-length files: we subtract one
from the length to exclude the trailing NUL (added by read_file), but a
zero-length file will result in a length of -1.

This change adds an explicit exit if we're attempting to parse an empty
file.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>

No differences found