cron_add accepted any non-whitespace after the fifth field (parse pointer
ignored). Require end-of-string after optional trailing whitespace so
inputs like '* * * * * garbage' are rejected. Smoke case TC006b.
Memory-safety pass over previously unsurveyed engine subsystems. Six
confirmed, adversarially-verified bugs, all reachable from untrusted
player input:
- scramble()/shuffle(): Fisher-Yates index arrays were sized LBUF_SIZE/2
but the cluster/word count can reach LBUF_SIZE, so a ~32 KB argument
overflowed the stack array. Both are CA_PUBLIC. (#845)
- view_atr()/flags(): decode_attr_flags() can emit NUM_ATTRIBUTE_CODES+1
bytes but two callers gave it an 11-byte buffer. (#846)
- do_reference()/absolute_named_reference(): used snprintf's return value
(intended length) directly as a copy/compare length, reading past the
buffer on truncation; @reference could leak the adjacent heap bytes back
via @reference/list. Clamped to min(n, LBUF_SIZE-1). (#847)
- @cron value/step parsing accumulated digits into a signed int without an
overflow guard (UB). (#848)
- index(): trailing-space trim decremented before testing, reading the byte
before the lbuf when an item begins at the delimiter. (#849)
Adds regression tests TC012-TC014 to overflow_inject_fn.mux. Build clean,
all 1258 smoke tests pass. Coverage recorded in
docs/survey-memsafety-pass-2026-06.md.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Three fixes for the Unix build after 68acbd2e:
1. cron.cpp: Fix infinite recursion in ctz64() — the non-MSVC path
called itself instead of __builtin_ctzll(). This caused 100% CPU
hang on first @cron command.
2. modules.cpp/externs.h: Move CConnectionManagerFactory and
CDriverControlFactory declarations from externs.h into modules.cpp
where they are actually used. Eliminates the BUILDING_DRIVER
preprocessor guard entirely — no cross-build-system coordination
needed.
3. svdrand.cpp: Gate PCG variant on __SIZEOF_INT128__ (compiler
capability) instead of _MSC_VER (compiler identity). Extracts
gather_entropy() with platform-specific paths. Replaces C-style
casts with static_cast/reinterpret_cast. PCG-XSL-RR-128/64 on
any compiler with __uint128_t; PCG-XSH-RR-64/32 otherwise.
493/493 smoke tests pass.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
5-field Unix cron syntax (minute hour dom month dow) with ranges,
lists, steps, and month/day-of-week names. Computed next-fire-time
scheduling integrates with CScheduler — no polling loop. In-memory
storage, recreated via @startup. DOM/DOW OR-semantics per Vixie cron.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>