MCPcopy Create free account
hub / github.com/erans/pgsqlite / parse_message_safely

Function parse_message_safely

tests/protocol_fuzzing_test.rs:158–166  ·  view source on GitHub ↗
(input: &[u8])

Source from the content-addressed store, hash-verified

156// Helper functions for safe parsing with error handling
157
158async fn parse_message_safely(input: &[u8]) -> Result<FrontendMessage, Box<dyn std::error::Error>> {
159 let mut cursor = Cursor::new(input);
160 let parser = MessageParser::new();
161
162 match parser.parse_message(&mut cursor).await {
163 Ok(msg) => Ok(msg),
164 Err(e) => Err(Box::new(e))
165 }
166}
167
168async fn parse_startup_message_safely(input: &[u8]) -> Result<StartupMessage, Box<dyn std::error::Error>> {
169 let mut cursor = Cursor::new(input);

Callers 2

Calls 1

parse_messageMethod · 0.80

Tested by

no test coverage detected