From cd4784376edeeedd663ecca88af19108271af834 Mon Sep 17 00:00:00 2001 From: ThePedroo Date: Tue, 10 Jun 2025 19:29:57 -0300 Subject: [PATCH] fix: ReZygiskd out-of-bounds write due to too small `system_arch` buffer This commit fixes the issue where when the "ro.product.cpu.abilist" prop has a value bigger than 31 characters, which mostly happens in WSA (Windows Subsystem For Android) as it can support 5+ architectures, it will write outside the buffer, leading to undefined behavior, but most of the time crashes. --- zygiskd/src/zygiskd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zygiskd/src/zygiskd.c b/zygiskd/src/zygiskd.c index b1a5740..eb1d2d1 100644 --- a/zygiskd/src/zygiskd.c +++ b/zygiskd/src/zygiskd.c @@ -48,7 +48,7 @@ enum Architecture { #define ZYGISKD_PATH "/data/adb/modules/rezygisk/bin/zygiskd" lp_select("32", "64") static enum Architecture get_arch(void) { - char system_arch[32]; + char system_arch[64]; get_property("ro.product.cpu.abilist", system_arch); if (strstr(system_arch, "arm") != NULL) return lp_select(ARM32, ARM64);