MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / fuzz_out_of_bounds_offset

Function fuzz_out_of_bounds_offset

nodedb-query/src/msgpack_scan/reader.rs:1017–1028  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1015 /// Out-of-bounds offset must return `None` — not panic.
1016 #[test]
1017 fn fuzz_out_of_bounds_offset() {
1018 let buf = encode(&json!({"x": 1}));
1019 let way_out = buf.len() + 1000;
1020 assert_eq!(skip_value(&buf, way_out), None);
1021 assert_eq!(read_f64(&buf, way_out), None);
1022 assert_eq!(read_i64(&buf, way_out), None);
1023 assert_eq!(read_str(&buf, way_out), None);
1024 assert_eq!(read_bool(&buf, way_out), None);
1025 assert_eq!(map_header(&buf, way_out), None);
1026 assert_eq!(array_header(&buf, way_out), None);
1027 assert_eq!(read_value(&buf, way_out), None);
1028 }
1029
1030 #[test]
1031 fn read_bin_advance_all_widths() {

Callers

nothing calls this directly

Calls 2

encodeFunction · 0.70
lenMethod · 0.45

Tested by

no test coverage detected