myxce/src
Rongsong Shen 1aa0761c12 fix(libxce): xce_strerror_r global-buffer-overflow on HA error codes (utils.c)
The E_XCE_* enum (errnox.h) gained NOMASTER/REDIRECT/NOT_READY/STANDBY
(10011-10014) but xce_err_str[] still had only 10 strings + NULL, while the
bounds check used E_XCE_MAX. Formatting any of those codes ran off the array:
NOMASTER -> strncpy(NULL) deref; NOT_READY (10013, returned by ctrlstatus on a
failover-exhausted cluster) -> read 8 bytes past the 88-byte table = the ASAN
global-buffer-overflow at utils.c:335.

Fix: fill the table for all 14 codes; bound xce_strerror_r against the actual
array size + NULL (degrade to 'unknown error', never OOB); add a _Static_assert
tying the table length to E_XCE_MAX so any future enum drift fails the build.
Pre-existing foundation bug surfaced (not caused) by controller-status 6.4.

RED: test_strerror_all_xce_codes SEGV'd at utils.c:335 under ASAN; GREEN: lib
suite Ok:1 Fail:0. New tests in test_error.c cover all in-range + out-of-range codes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20 10:13:21 +00:00
..
autoscaler support shared libxce(for api server) 2026-01-19 11:02:49 +08:00
controller feat(controller-status): render responderTime in cmd_ctrlstatus, log-comparable format (task 6.3) 2026-06-20 09:28:49 +00:00
docs docs(ha-single-leader-role): sync steering + contributor docs to three-state model + own-term gate (task 6.1) 2026-06-13 14:58:55 +00:00
frontend chore: baseline snapshot — prior-session work + ha-consistency-invariants spec family 2026-06-11 13:21:50 +00:00
include feat(controller-status): add responderTimeMs @13 to CtrlStatus schema + typemap (task 6.1) 2026-06-20 08:56:51 +00:00
lib fix(libxce): xce_strerror_r global-buffer-overflow on HA error codes (utils.c) 2026-06-20 10:13:21 +00:00
nixSupport Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00
scheduler test(scheduler-controller-msg-gap): real handler/applier unit tests (bug-765 G-6) 2026-06-19 04:14:20 +00:00
schema feat(controller-status): add responderTimeMs @13 to CtrlStatus schema + typemap (task 6.1) 2026-06-20 08:56:51 +00:00
tools test(xce-test-e2e-primitives): harden durability soak — separate liveness from durability, no false bug-661 cascades 2026-06-20 01:27:38 +00:00
worker enhance xce-build skill 2026-05-30 08:13:59 +08:00
build chore: checkpoint all prior work for clean state 2026-06-04 13:04:16 +00:00
flake.lock docs: mark Phase 6 complete in phase6-scheduler-integration-plan 2026-04-30 07:17:32 +00:00
flake.nix save works 2026-03-04 18:18:53 +08:00
meson.build Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00
meson.options Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00