From f8a299cd6317f86b2ea949d5c1edbfeb40f8be61 Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Tue, 5 Aug 2025 11:59:35 +0200 Subject: [PATCH] repo_apk: move entry size limit to the top of the file --- ext/repo_apk.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/repo_apk.c b/ext/repo_apk.c index ec151591..7332e8b1 100644 --- a/ext/repo_apk.c +++ b/ext/repo_apk.c @@ -26,6 +26,8 @@ #include "repo_apk.h" #include "repo_apkv3.h" +#define MAX_ENTRY_SIZE 0x1000000 + static inline ssize_t apk_fillbuf(unsigned char *buf, size_t count, int fd, FILE *fp) { @@ -453,7 +455,7 @@ repo_add_apk_pkg(Repo *repo, const char *fn, int flags) tarhead_skip(&th); continue; } - if (th.length > 10 * 1024 * 1024) + if (th.length >= MAX_ENTRY_SIZE) { pool_error(pool, -1, "%s: oversized .PKGINFO", fn); break; -- 2.47.2