change the data input read from file to read from fuzzer.
(&mut self)
| 206 | |
| 207 | /// change the data input read from file to read from fuzzer. |
| 208 | fn change_input_data_fuzzable(&mut self) -> Result<()> { |
| 209 | let visitor = self.get_new_visitor()?; |
| 210 | // whether needs to cast the type of bytes. |
| 211 | let init_stmt = if let Some(ty_name) = visitor.find_ty_with_arg_name("data") { |
| 212 | // whether append a null terminator at the end of bytes. |
| 213 | if self.deopt.config.should_terminate_with_null() { |
| 214 | format!("FDPConsumeRawBytesWithNullTerm({ty_name}, data, size, fdp)") |
| 215 | } else { |
| 216 | format!("FDPConsumeRawBytes({ty_name}, data, size, fdp)") |
| 217 | } |
| 218 | } else if self.deopt.config.should_terminate_with_null() { |
| 219 | "FDPConsumeRawBytesWithNullTerm(const uint8_t *, data, size, fdp)".to_string() |
| 220 | } else { |
| 221 | "FDPConsumeRawBytes(const uint8_t *, data, size, fdp)".to_string() |
| 222 | }; |
| 223 | self.fuzzer_shim.append_fuzzer_stmt(init_stmt); |
| 224 | self.write_fuzzer_vars_stmts()?; |
| 225 | replace_string_in_file(&self.src_file, "const uint8_t *data; size_t size;", "")?; |
| 226 | Ok(()) |
| 227 | } |
| 228 | |
| 229 | /// make up a variable for this call's string arg. |
| 230 | fn makeup_call_string_arg( |
no test coverage detected