From a213386d08eda39be0d3786d5e9c838626b4e823 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Mon, 17 Apr 2023 13:49:00 -0400 Subject: ustar: Verify full magic field --- (limited to 'src/ustar.c') diff --git a/src/ustar.c b/src/ustar.c index c183560..989794b 100644 --- a/src/ustar.c +++ b/src/ustar.c @@ -93,7 +93,7 @@ _opkg_opk_ustar_next(struct opkg_opk_ustar *ustar, return OPKG_OPK_END; } - if (memcmp(header->magic, "ustar", strlen("ustar")) != 0) { + if (memcmp(header->magic, "ustar\0", sizeof(header->magic)) != 0) { return OPKG_OPK_ERROR; } -- cgit v0.9.1