Skip to content

Commit 07d5d76

Browse files
committed
Added several fuzz corpus.
1 parent dfe1397 commit 07d5d76

12 files changed

Lines changed: 94 additions & 0 deletions

File tree

fuzz.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
cargo fuzz run fuzz_target_1

fuzz/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
target
2+
artifacts
3+
corpus/*/*
4+
!corpus/*/*.seed

fuzz/Cargo.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
[package]
3+
name = "dbgen-fuzz"
4+
version = "0.0.1"
5+
authors = ["Automatically generated"]
6+
publish = false
7+
8+
[package.metadata]
9+
cargo-fuzz = true
10+
11+
[dependencies]
12+
tempfile = "3.0"
13+
14+
[dependencies.dbgen]
15+
path = ".."
16+
[dependencies.libfuzzer-sys]
17+
git = "https://github.com/rust-fuzz/libfuzzer-sys.git"
18+
19+
# Prevent this from interfering with workspaces
20+
[workspace]
21+
members = ["."]
22+
23+
[[bin]]
24+
name = "fuzz_target_1"
25+
path = "fuzz_targets/fuzz_target_1.rs"

fuzz/corpus/fuzz_target_1/a.seed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/*Yt0idEQBIu,I!H~F&U{ylX@:!Qg^*/Create Table Foo.Bar(a Integer{{@a:=rownum}},b Integer{{@a}},c Integer{{rownum}},d Real{{rand.uniform(0,1)}});

fuzz/corpus/fuzz_target_1/b.seed

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--#F&"x}Gk@95--"<FVS.RqOEbJLy~=+/* comments */
2+
-- comments
3+
CREATE
4+
TABLE
5+
`foo`
6+
(
7+
`x` CHAR(20) {{ `rand`.`regex`('[a-z]{19}\w', 'a') }},
8+
`y` VARCHAR(30) {{ `rand`.`regex`('(x-|ggh-)\d{2,5}:.{0,13}') }},
9+
`z` INT {{ `greatest`(`rand`.`range`(0, 256), `rand`.`range`(0, 256)) }}
10+
) ENGINE=InnoDB;

fuzz/corpus/fuzz_target_1/c.seed

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*vGc!1wid7"?D*d>C1AxsGGJ=BUDo*/create table [contacts] (
2+
[contact id] integer primary key {{ rownum + 0x1000 }},
3+
[first name] text not null {{ @first := rand.regex('[A-Z][a-z]*') }},
4+
[last name] text not null {{ @last := rand.regex('[A-Z][a-z]*') }},
5+
[email] text not null unique {{ @first || '.' || @last || '@' || rand.regex('\w+\.com') }},
6+
[phone] text unique {{ case rand.bool(0.9) when true then rand.regex('[0-9#*]{8}') end }},
7+
[last updated] datetime not null {{ timestamp '2015-01-01 00:00:00' + interval rownum day }}
8+
);

fuzz/corpus/fuzz_target_1/d.seed

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/*FS4^X;,8lV8i#pG?7uxEpf"DiP9s*/cREaTE tABle "αブ$"("èç¡"TexT{{rAND.rEgEx('éı[&①]')}}
2+
{{0x1+(2-3)*4.0/-5 oR FalSE AnD NOt 0.0}}{{rOwNUm/(rowNUM-1)}}COmMeNT'☺≠6¿ū',"ßK~“"iNTeGeR,"¢_""++"DOUble NuLL,iNDex("èç¡"))/*ω★*/;

fuzz/corpus/fuzz_target_1/e.seed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
a^zqe)u_eC2rSpO$D@u_m)+JfVKseOo\create database xyz;

fuzz/corpus/fuzz_target_1/f.seed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(R7ByrB=s$n2M,MU[xfN^{P`g`pjo398create table x({{5-}});

fuzz/corpus/fuzz_target_1/g.seed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
wG?d?zosInBxQ+\_y5BJFks80G?449@Xcreate table m({{@}});

0 commit comments

Comments
 (0)