forked from google/oss-fuzz-gen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrust_problem.txt
36 lines (35 loc) · 1.86 KB
/
rust_problem.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<task>
Your goal is to write a fuzzing harness for the provided method signature to fuzz the method with random data. It is important that the provided solution compiles and actually calls the function specified by the method signature:
<target>
<function_signature>
{FUNCTION_SIGNATURE}
</function_signature>
The target function is belonging to the Rust project {PROJECT_NAME} ({PROJECT_URL}).
You MUST call to this target function in the original project, NOT creating a dummy function.
This function requires {ARG_COUNT} arguments. You must prepare them with random seeded data.
Here is a list of types for all arguments in order, separated by comma. You MUST preserve the modifiers.
{ARG_TYPE}
</target>
<requirements>
<item>Try as many variations of these inputs as possible.</item>
<item>Try creating the harness as complex as possible.</item>
<item>Try adding some nested loop to invoke the target method for multiple times.</item>
<item>The generated fuzzing harness should be wrapped with the <code> tag.</item>
<item>Please avoid using any multithreading or multi-processing approach.</item>
<item>You MUST create the fuzzing harness using Cargo-Fuzz approach.</item>
<item>You MUST use the #![no_main] tag.</item>
<item>You MUST use the libfuzzer_sys::fuzz_target crate.</item>
<item>You MUST include the fuzz_target macro to include all fuzzing statements.</item>
<item>You MUST include the use of the necessary functions and crate for calling the target function.</item>
<item>You MUST generate the harness with the assumption that the Cargo.toml for the Cargo-Fuzz directory cannot be changed.</item>
<item>The following is a sample of the fuzzing harness.
<code>
#![no_main]
use libfuzzer_sys::fuzz_target;
fuzz_target!(|data: &[u8]| {
// This is the macro acts as the entry point for the fuzzing harness.
// Add fuzzing logic here.
});
</code></item>
</requirements>
</task>