From 3d8bfdeba641dd7fe780033bd348ef25dda943d3 Mon Sep 17 00:00:00 2001 From: arcattack Date: Fri, 24 Jul 2026 00:10:04 -0500 Subject: [PATCH] Hardening: unknown vehicle= in the egg fails loud instead of segfaulting Found during the #35 (Owens laser crash) hunt: FindResourceDescription returns NULL for an unknown vehicle name and release builds (Check compiled out) segfaulted on Lock() -- a typo'd or corrupted vehicle tag in a served egg would crash EVERY pod at drop. Now logs '[spawn] FATAL: unknown vehicle' + Fail() with a clean exit. Verified: vehicle=nosuch -> message + exit 127 (was a segfault). Co-Authored-By: Claude Opus 4.8 (1M context) --- game/reconstructed/btplayer.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/game/reconstructed/btplayer.cpp b/game/reconstructed/btplayer.cpp index 4d3a4c5..9824ab0 100644 --- a/game/reconstructed/btplayer.cpp +++ b/game/reconstructed/btplayer.cpp @@ -930,7 +930,21 @@ void playerMission->GetGameModel(), ResourceDescription::ModelListResourceType ); - Check(mech_res); + // + // HARDENING (found during the #35 hunt): an unknown vehicle= name in + // the egg (a typo, or a corrupted relay rewrite) returned NULL here + // and SEGFAULTED on Lock() in release (Check compiles out). A bad + // tag in a served egg would crash EVERY pod -- fail loud instead. + // + if (mech_res == 0) + { + DEBUG_STREAM << "[spawn] FATAL: unknown vehicle '" + << (playerMission->GetGameModel() + ? playerMission->GetGameModel() : "") + << "' in the egg (no such ModelList resource)\n" << std::flush; + Fail("unknown vehicle= name in the egg -- check the mission file\n"); + return; + } mech_res->Lock(); Mech::MakeMessage