From c45d252c3dd6b5a13de631d22cf359fa7f1d8806 Mon Sep 17 00:00:00 2001 From: chrg6 Date: Mon, 9 Nov 2026 05:57:18 -0500 Subject: [PATCH] Read an exefs.status line only to its own end. Co-Authored-By: Claude Opus 5.5 --- runtime/mods.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime/mods.c b/runtime/mods.c index 7bc2daf5..dcaf70a6 100644 --- a/runtime/mods.c +++ b/runtime/mods.c @@ -225,7 +225,8 @@ static int status_line(const char *key, const char *content, char *kind, char *o size_t len = end ? (size_t)(end - line) : strlen(line); if (len > 18 && !memcmp(line, want, 18)) { char copy[600]; - snprintf(copy, sizeof copy, "%.*s", (int)(len < sizeof copy ? len : sizeof copy - 1), line + 18); + size_t rest = len - 18; // the line after the 18 bytes compared, not into the next line + snprintf(copy, sizeof copy, "%.*s", (int)(rest < sizeof copy ? rest : sizeof copy - 1), line + 18); char *t1 = strchr(copy, '\t'), *t2 = t1 ? strchr(t1 + 1, '\t') : NULL; if (!t1 || !t2) return 0; *t1 = *t2 = 0;