From dcf89d944482319f5534f2f466d21cd057a8e307 Mon Sep 17 00:00:00 2001 From: dingo Date: Sun, 11 Oct 2026 19:00:21 -0400 Subject: [PATCH] Parse clone sites through bounded views --- apps/evo-world-clone/main.cpp | 11 ++++++----- docs/engineering/VALIDATION.md | 2 ++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/evo-world-clone/main.cpp b/apps/evo-world-clone/main.cpp index f6bc04c..6983d2e 100644 --- a/apps/evo-world-clone/main.cpp +++ b/apps/evo-world-clone/main.cpp @@ -121,12 +121,13 @@ std::optional site(std::string_view text) { const auto comma = text.find(','); if (comma == std::string_view::npos || text.find(',', comma + 1) != std::string_view::npos) return std::nullopt; + const auto x_text = text.substr(0, comma); + const auto y_text = text.substr(comma + 1); std::int32_t x{}, y{}; - const auto [x_end, x_error] = std::from_chars(text.data(), text.data() + comma, x); - const auto [y_end, y_error] = - std::from_chars(text.data() + comma + 1, text.data() + text.size(), y); - if (x_error != std::errc{} || x_end != text.data() + comma || y_error != std::errc{} || - y_end != text.data() + text.size()) + const auto [x_end, x_error] = std::from_chars(x_text.begin(), x_text.end(), x); + const auto [y_end, y_error] = std::from_chars(y_text.begin(), y_text.end(), y); + if (x_error != std::errc{} || x_end != x_text.end() || y_error != std::errc{} || + y_end != y_text.end()) return std::nullopt; return server::SpawnSite{x, y}; } diff --git a/docs/engineering/VALIDATION.md b/docs/engineering/VALIDATION.md index 60b80f1..c10d537 100644 --- a/docs/engineering/VALIDATION.md +++ b/docs/engineering/VALIDATION.md @@ -7014,3 +7014,5 @@ CI run #305 passed formatting and most independent gates, but PostgreSQL clang-t CI run #306 passed formatting, deploy selection, ECS, and TSan, and built the PostgreSQL test targets. Its client lifecycle probe failed at `native_input()` while opening the SDL application (line 174); the test reported only the source line and an empty SDL error, so the startup error was not identifiable. It has been updated to report the typed application error and SDL initialization state. PostgreSQL static analysis was still running when this follow-up was prepared; Harbor publication did not start. CI run #307 passed the format/deploy/ECS/network/TSan gates. The instrumented `native_input()` open succeeded, but the next application open in `toolkit_capture()` failed (line 277 in that run), before PostgreSQL analysis completed; Harbor publication did not start. This second open now reports its typed error and SDL initialization state too, so the next run can distinguish an SDL window failure from toolkit initialization. + +CI run #308 passed client, deploy, ECS, network and TSan, including the X11 lifecycle and AddressSanitizer client probes. PostgreSQL clang-tidy again rejected `site()` in `apps/evo-world-clone/main.cpp`, this time because `bugprone-suspicious-stringview-data-usage` treats `string_view::data()` on the split coordinate text as potentially unterminated even though `from_chars` receives a bounded range. The parser now passes the split views' begin/end iterators instead. The PostgreSQL tools and server-image/Harbor jobs did not start.