about summary refs log tree commit diff
path: root/boot/catboot.c
diff options
context:
space:
mode:
Diffstat (limited to 'boot/catboot.c')
-rw-r--r--boot/catboot.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/boot/catboot.c b/boot/catboot.c
index 23b649e..79a5e2b 100644
--- a/boot/catboot.c
+++ b/boot/catboot.c
@@ -31,6 +31,8 @@ read_file(const ascii* path)
     struct stat stat_info;
     if (stat(path, &stat_info) == -1) failure("i couldn't open that file, sorry :(");
 
+    check(stat_info.st_size > 0, "file is empty, i can't map an empty file");
+
     const int32 file_descriptor = open(path, O_RDONLY);
     check(file_descriptor != -1, "i couldn't open that file, sorry :(");