summaryrefslogtreecommitdiffstats
path: root/test/parser/Makefile.am
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2014-06-04 15:45:53 +0800
committerJeremy Kerr <jk@ozlabs.org>2014-06-05 15:25:10 +0800
commit8c430d0509a2f1f5dc64de308d1c1d2668d2031b (patch)
tree18cb9a8671f977e49c0aab70e718e9ecd224b8cf /test/parser/Makefile.am
parentdcc2bd8913d3741614e971b0be12f490d8334538 (diff)
downloadtalos-petitboot-8c430d0509a2f1f5dc64de308d1c1d2668d2031b.tar.gz
talos-petitboot-8c430d0509a2f1f5dc64de308d1c1d2668d2031b.zip
grub2: fix empty file handling
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>
Diffstat (limited to 'test/parser/Makefile.am')
-rw-r--r--test/parser/Makefile.am1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/parser/Makefile.am b/test/parser/Makefile.am
index b36889d..283b284 100644
--- a/test/parser/Makefile.am
+++ b/test/parser/Makefile.am
@@ -29,6 +29,7 @@ TESTS = \
test-null \
test-grub2-single \
test-grub2-default \
+ test-grub2-empty \
test-grub2-default-index \
test-grub2-default-multiword \
test-grub2-multiple-resolve \
OpenPOWER on IntegriCloud