From 3223b10b7336c09dcb208d311c04aac11f38e778 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Mon, 17 Apr 2023 13:44:52 -0400 Subject: ustar: Verify version --- (limited to 'src') 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_); -- cgit v0.9.1