From 4a7367219046f1767e6dc1795dc98942d3667f74 Mon Sep 17 00:00:00 2001 From: weishu Date: Sat, 30 Mar 2024 16:13:08 +0800 Subject: [PATCH] kernel: fix potential dead loop Co-Authored-by: qwerty472123 --- kernel/apk_sign.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/apk_sign.c b/kernel/apk_sign.c index 7e11f9f6..c2a55623 100644 --- a/kernel/apk_sign.c +++ b/kernel/apk_sign.c @@ -229,7 +229,8 @@ static __always_inline bool check_v2_signature(char *path, goto clean; } - for (;;) { + int loop_count = 0; + while (loop_count++ < 10) { uint32_t id; uint32_t offset; ksu_kernel_read_compat(fp, &size8, 0x8,