Files
Marc Schier e4f4629f48 Initialize encoder fuzz ServiceMessageContext (OPC 10000-6) (#4035)
## Failure

The encoder fuzz host relied on NUnit or corpus-tool setup to assign
`FuzzableCode.MessageContext`. Direct afl-fuzz/libFuzzer startup could
therefore
reach encoder targets without an initialized OPC UA message context.

## Fix

- Initialize one process-lifetime `ServiceMessageContext` with null
logging.
- Make the context immutable and remove test/tool reassignment.
- Exercise the same context from regression tests and the standalone
fuzz host.

## Reference

- OPC 10000-6 encoding validation.
- Split from #4021.

## Tests

- `dotnet test
fuzzing\Opc.Ua.Encoders.Fuzz.Tests\Opc.Ua.Encoders.Fuzz.Tests.csproj -c
Release -f net10.0 --nologo` (4,569 passed)
- `dotnet run --project
fuzzing\Opc.Ua.Encoders.Fuzz\Opc.Ua.Encoders.Fuzz.csproj -c Release --`
(standalone smoke passed)

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-22 04:07:14 +02:00
..