Vixen
caa30e12
csharp
public static class FuzzTargets

Every decode path bytes we did not write can reach, in one place.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

The list is the claim. "The packet reader is fuzzed" is a much smaller statement than it sounds: the reader is the bottom of the stack, and above it sit a handshake that reads four fields from an unauthenticated connection, a router that dispatches on a pair of indices, an applier that creates and destroys entities, and a list that takes an index off the wire and mutates itself with it. All of those are reachable by somebody who can send a packet, so all of them are here.

And then the files, which arrive by a different route and are the same problem. A bundle, a stored chunk and a heightmap PNG are not packets, and the machinery here never required one — a target is a decoder with bytes pushed into it. A content update downloads a bundle, a chunk comes out of it, and an importer is handed a PNG by a person who cannot know what is in it; each has a length prefix that decides an allocation, which is the property this harness was built to hold decoders to. See ContentTargets for why those three catch their own documented refusal where the packet targets catch nothing.

And then the grammars, whose input is text and which needed nothing new to fuzz. A sidecar, a declaration value and an @layer rule are characters rather than bytes, and the corpus, the mutator and all four oracles are indifferent to that: each target decodes at its own edge, which is what the real system does with a file too. Two of them also carry an oracle the byte targets have no use for — an answer that is wrong rather than absent, checked by reading the same input twice and comparing. See MetaTargets and StylingTargets.

Each is constructed fresh, because several hold live state — a session with a player in it, a client with a world behind it — and sharing one between runs would make a run depend on what ran before it.

Fields and properties (1)

  • public static IReadOnlyList<string> Names

    The names, for a command line and for a report.

Methods (2)

  • public static IReadOnlyList<IFuzzTarget> All()

    Builds every target.

  • public static IFuzzTarget Named(string name)

    Builds one target by name.

Used by (1)

  • FuzzGateTestsVixen.Fuzz.Tests