forked from gyscos/cursive
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alexander Kjäll
committed
Aug 19, 2020
1 parent
b75b501
commit fada646
Showing
4 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
target | ||
corpus | ||
artifacts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
[package] | ||
name = "cursive-fuzz" | ||
version = "0.0.0" | ||
authors = ["Automatically generated"] | ||
publish = false | ||
edition = "2018" | ||
|
||
[package.metadata] | ||
cargo-fuzz = true | ||
|
||
[dependencies] | ||
libfuzzer-sys = "0.3" | ||
|
||
[dependencies.cursive] | ||
path = ".." | ||
default-features = false | ||
features = ["crossterm-backend"] | ||
|
||
# Prevent this from interfering with workspaces | ||
[workspace] | ||
members = ["."] | ||
|
||
[[bin]] | ||
name = "fuzz_target_1" | ||
path = "fuzz_targets/fuzz_target_1.rs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#![no_main] | ||
use libfuzzer_sys::fuzz_target; | ||
|
||
use cursive::views::{Dialog, TextView}; | ||
use std::str; | ||
|
||
use std::thread; | ||
use std::time::Duration; | ||
|
||
fuzz_target!(|data: &[u8]| { | ||
let str = str::from_utf8(data); | ||
if let Ok(s) = str { | ||
// Creates the cursive root - required for every application. | ||
let mut siv = cursive::default(); | ||
|
||
// Creates a dialog with a single "Quit" button | ||
siv.add_layer(Dialog::around(TextView::new(s)) | ||
.title("Cursive") | ||
.button("Quit", |s| s.quit())); | ||
|
||
siv.step(); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters