summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2023-04-17 13:44:52 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2023-04-17 14:34:50 (EDT)
commit3223b10b7336c09dcb208d311c04aac11f38e778 (patch)
treed4ba72ef88c65f7cce332064b8d88b6edd0efa70 /src
parent38c8dc91a43cbb8d7d08e92c5149929a12007840 (diff)
ustar: Verify version
Diffstat (limited to 'src')
-rw-r--r--src/ustar.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ustar.c b/src/ustar.c
index c183560..26b581d 100644
--- a/src/ustar.c
+++ b/src/ustar.c
@@ -96,6 +96,10 @@ _opkg_opk_ustar_next(struct opkg_opk_ustar *ustar,
if (memcmp(header->magic, "ustar", strlen("ustar")) != 0) {
return OPKG_OPK_ERROR;
}
+ if (memcmp(header->version, "00", strlen("00")) != 0 &&
+ memcmp(header->version, " \0", strlen(" \0")) != 0) {
+ return OPKG_OPK_ERROR;
+ }
chksum_got = strtol((char *) header->chksum, &end,
OPKG_OPK_USTAR_NUM_BASE_);