Files
Dave Kempe 1922bd9987 Add fuzz testing infrastructure and fix UTF-8 boundary panic
Add cargo-fuzz targets for the Guacamole protocol parser:
- protocol_parse: single instruction parsing
- protocol_stream: streaming parser with chunked input

Fix panic in Instruction::parse when a length prefix splits a multi-byte
UTF-8 character (found by fuzzer within seconds). Now returns
ParseError::Truncated instead of panicking on invalid char boundary.

Run with: cargo +nightly fuzz run protocol_parse
          cargo +nightly fuzz run protocol_stream

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 13:39:16 +11:00

11 lines
250 B
Rust

#![no_main]
use libfuzzer_sys::fuzz_target;
use rustguac::protocol::Instruction;
fuzz_target!(|data: &[u8]| {
if let Ok(s) = std::str::from_utf8(data) {
// Fuzz single-instruction parsing
let _ = Instruction::parse(s);
}
});