mirror of
https://github.com/sol1/rustguac.git
synced 2026-09-11 01:55:38 +00:00
1922bd9987
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>
11 lines
250 B
Rust
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);
|
|
}
|
|
});
|