surrealpatch/sdk/fuzz/fuzz_targets/fuzz_structured_executor.rs
2024-08-22 10:26:03 +00:00

13 lines
433 B
Rust

#![no_main]
use libfuzzer_sys::fuzz_target;
use std::hint::black_box;
use surrealdb::{dbs::Session, kvs::Datastore, sql::Query};
fuzz_target!(|query: Query| {
tokio::runtime::Builder::new_current_thread().enable_all().build().unwrap().block_on(async {
let dbs = Datastore::new("memory").await.unwrap();
let ses = Session::owner().with_ns("test").with_db("test");
_ = black_box(dbs.process(query, &ses, None).await);
})
});