summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index d50ee4c..90fbb2f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -156,6 +156,10 @@ static void map_entries(char *path, struct params p) {
return;
}
+ if (h->table_offset > archive->len) {
+ fprintf(stderr, "Invalid table offset. Archive corrupt.\n");
+ return;
+ }
stream_seek(archive, h->table_offset, SEEK_SET);
struct stream *table = load_table(archive);