Fork of https://github.com/oxigraph/oxigraph.git for the purpose of NextGraph project
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
696 B
29 lines
696 B
2 years ago
|
#![no_main]
|
||
|
|
||
|
use libfuzzer_sys::fuzz_target;
|
||
|
use oxttl::N3Parser;
|
||
|
|
||
|
fuzz_target!(|data: &[u8]| {
|
||
|
let mut quads = Vec::new();
|
||
|
let mut parser = N3Parser::new()
|
||
|
.with_base_iri("http://example.com/")
|
||
|
.unwrap()
|
||
|
.parse();
|
||
|
for chunk in data.split(|c| *c == 0xFF) {
|
||
|
parser.extend_from_slice(chunk);
|
||
|
while let Some(result) = parser.read_next() {
|
||
|
if let Ok(quad) = result {
|
||
|
quads.push(quad);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
parser.end();
|
||
|
while let Some(result) = parser.read_next() {
|
||
|
if let Ok(quad) = result {
|
||
|
quads.push(quad);
|
||
|
}
|
||
|
}
|
||
|
assert!(parser.is_end());
|
||
|
//TODO: serialize
|
||
|
});
|