Skip to content

Commit 7dfd503

Browse files
committed
maybe fix fuzzer?
1 parent 952a163 commit 7dfd503

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

.evergreen/run-fuzzer.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ run_fuzzer() {
3030
}
3131

3232
# Run existing targets
33-
run_fuzzer "deserialize"
33+
run_fuzzer "decode"
3434
run_fuzzer "raw_deserialize"
35+
run_fuzzer "raw_deserialize_utf8_lossy"
3536
run_fuzzer "iterate"
3637

3738
# Run new security-focused targets

fuzz/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ name = "string_handling"
4949
path = "fuzz_targets/string_handling.rs"
5050

5151
[[bin]]
52-
name = "serialization"
53-
path = "fuzz_targets/serialization.rs"
52+
name = "encoding"
53+
path = "fuzz_targets/encoding.rs"
5454

5555
[[bin]]
5656
name = "generate_corpus"

fuzz/fuzz_targets/encoding.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ fn compare_values(val1: &Bson, val2: &Bson) -> bool {
4545
}
4646

4747
fuzz_target!(|input: &[u8]| {
48-
if let Ok(rawdoc) = RawDocument::from_bytes(&input) {
48+
if let Ok(rawdoc) = RawDocument::decode_from_bytes(&input) {
4949
if let Ok(doc) = Document::try_from(rawdoc) {
5050
let out = RawDocumentBuf::try_from(&doc).unwrap();
5151
let out_bytes = out.as_bytes();
5252
if input != out_bytes {
53-
let reencoded = RawDocument::from_bytes(&out_bytes).unwrap();
53+
let reencoded = RawDocument::decode_from_bytes(&out_bytes).unwrap();
5454
let reencoded_doc = Document::try_from(reencoded).unwrap();
5555
// Ensure that the re-encoded document is the same as the original document, the
5656
// bytes can differ while still resulting in the same Document.

0 commit comments

Comments
 (0)