From ff695f26d51b9c2192593066b294f630e0799a03 Mon Sep 17 00:00:00 2001 From: gatecat Date: Wed, 25 Jun 2025 11:58:11 +0200 Subject: [PATCH] sdc: Fix EOF handling during string parse Fixes #1490 Signed-off-by: gatecat --- common/kernel/sdc.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/common/kernel/sdc.cc b/common/kernel/sdc.cc index 0fbfe690..7858af20 100644 --- a/common/kernel/sdc.cc +++ b/common/kernel/sdc.cc @@ -186,8 +186,12 @@ struct SDCParser s += c; while (true) { - if (eof()) - log_error("EOF while parsing string '%s'\n", s.c_str()); + if (eof()) { + if (in_quotes || in_braces || escaped) + log_error("EOF while parsing string '%s'\n", s.c_str()); + else + break; + } char c = peek(); if (!in_quotes && !in_braces && !escaped && (std::isblank(c) || c == ']')) {