()
| 313 | } |
| 314 | |
| 315 | fn generate_query_message_fuzzing() -> Vec<Vec<u8>> { |
| 316 | let mut inputs = Vec::new(); |
| 317 | |
| 318 | let long_query = "A".repeat(1000); |
| 319 | |
| 320 | // Simple queries |
| 321 | let queries = [ |
| 322 | "SELECT 1", |
| 323 | "SELECT * FROM users", |
| 324 | "INSERT INTO test VALUES (1)", |
| 325 | "", |
| 326 | long_query.as_str(), |
| 327 | "SELECT 1; DROP TABLE users; --", |
| 328 | "SELECT * FROM users WHERE id = 1 OR 1=1", |
| 329 | "\x00\x01\x02\x03", // Binary data |
| 330 | ]; |
| 331 | |
| 332 | for query in &queries { |
| 333 | let mut msg = vec![b'Q']; |
| 334 | msg.extend_from_slice(&((query.len() + 5) as u32).to_be_bytes()); |
| 335 | msg.extend_from_slice(query.as_bytes()); |
| 336 | msg.push(0); // Null terminator |
| 337 | inputs.push(msg); |
| 338 | } |
| 339 | |
| 340 | inputs |
| 341 | } |
| 342 | |
| 343 | fn generate_performance_attack_inputs() -> Vec<Vec<u8>> { |
| 344 | let mut inputs = Vec::new(); |
no test coverage detected