mirror of
https://github.com/J3vb/OwnCord.git
synced 2026-09-03 03:50:00 +03:00
The guest's linear memory was taken from mod.Memory() and used unchecked, so an untrusted plugin wasm with no memory section nil-dereferenced on the unrecovered startup path and crashed the server. All guest-memory access now goes through one guestMemory() helper that detects wazero's non-nil interface wrapping a nil *MemoryInstance, binding no commands at activation and returning the existing missing-export diagnostic on dispatch. Verified by a panel of agents; the added regression test panics with the finding's exact stack against the unpatched tree. Note: TestRegistry_Activate_WithoutRuntime and TestRegistry_EnablePlugin_RollsBackWhenActivationFails fail under -tags wazero, confirmed here to fail identically on the base tree. They are pre-existing and unrelated; CI builds the wazero variant but does not test it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>