Overview of postgres_parameter_messages fuzz target
mainThe postgres_parameter_messages fuzz target tests the parsing robustness of PostgreSQL protocol parameter messages. It focuses on two primary message types:
ParameterDescription (
parse_parameter_descriptioninsrc/database/postgres.rs):- Format:
i16parameter count followed by an array ofi32OID values. - Tests: Negative counts, oversized arrays, and invalid OIDs.
- Format:
ParameterStatus (
handle_parameter_statusinsrc/database/postgres.rs):- Format: Null-terminated parameter name followed by a null-terminated value.
- Tests: Embedded nulls, encoding corruption, and oversized strings.
The fuzzer uses structure-aware generation to create test cases including standard PostgreSQL types (e.g., TEXT(25), INT4(23), BOOL(16), UUID(2950)), common runtime parameters (e.g., application_name, client_encoding, TimeZone), and various corruption patterns like truncated messages or invalid UTF-8.