diff options
| author | jakob <jakob@memeware.net> | 2017-06-26 12:38:08 -0400 |
|---|---|---|
| committer | jakob <jakob@memeware.net> | 2017-06-26 12:38:08 -0400 |
| commit | f1a78a551cabe3ce95e076defc03ab41cfa825b6 (patch) | |
| tree | da5fa64f8aa57b03a5057a6545596116944a9576 /src/main.c | |
| parent | a26f9e063e2f3f715b87566126c51fc966354529 (diff) | |
Add archive integrity checks. (Thanks, AFL\!)
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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); |