From 73820e4a3e63f9631bc3b25e69743f13c3b4846e Mon Sep 17 00:00:00 2001 From: Timo Teräs Date: Fri, 20 Sep 2013 21:51:57 +0300 Subject: archive: fix handling of name lengths of exactly 100 bytes --- src/archive.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/archive.c b/src/archive.c index 771e548..66b4870 100644 --- a/src/archive.c +++ b/src/archive.c @@ -158,6 +158,9 @@ int apk_tar_parse(struct apk_istream *is, apk_archive_entry_parser parser, }; teis.csum = NULL; + buf.mode[0] = 0; /* to nul terminate 100-byte buf.name */ + buf.magic[0] = 0; /* to nul terminate 100-byte buf.linkname */ + if (memcmp(di->id, "APK2", 4) == 0 && di->size <= sizeof(entry.csum.data)) { entry.csum.type = di->size; -- cgit v1.2.3-70-g09d2