Fix entity decoding in attribute; create fuzzer project; simplify code
This commit is contained in:
parent
d368092aa7
commit
95be64d868
10 changed files with 143 additions and 76 deletions
3
fuzz/.gitignore
vendored
Normal file
3
fuzz/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
/out
|
||||
/target
|
||||
/Cargo.lock
|
||||
9
fuzz/Cargo.toml
Normal file
9
fuzz/Cargo.toml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
[package]
|
||||
name = "hyperbuild-fuzz-target"
|
||||
version = "0.0.1"
|
||||
authors = ["Wilson Lin <code@wilsonl.in>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
afl = "0.5.2"
|
||||
hyperbuild = { path = ".." }
|
||||
28
fuzz/in/complex.html
Normal file
28
fuzz/in/complex.html
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
Hello 	
|
||||
there
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
|
||||
<body class="	
|
||||
b " data="a" class=" 	
|
||||
|
||||
">
|
||||
a
|
||||
<div data-a='{""asin"":""B07GY8C9JV""} '>ÆA</div>
|
||||
<p> Hello </p>
|
||||
|
||||
<script type="text/html"><!--
|
||||
<h1>In</h1>
|
||||
<script>
|
||||
<script>
|
||||
alert();
|
||||
</script>
|
||||
<script>
|
||||
alert();
|
||||
</script>
|
||||
</script>
|
||||
<h1>Test</h1>
|
||||
</body>
|
||||
</html>
|
||||
12
fuzz/in/hello-world.html
Normal file
12
fuzz/in/hello-world.html
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<title>Hello world!</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
Hello world!
|
||||
</body>
|
||||
</html>
|
||||
9
fuzz/in/script.html
Normal file
9
fuzz/in/script.html
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<!-- HTML4 -->
|
||||
<script type="text/javascript">
|
||||
alert("Hello World!");
|
||||
</script>
|
||||
|
||||
<!-- HTML5 -->
|
||||
<script>
|
||||
alert("Hello World!");
|
||||
</script>
|
||||
9
fuzz/src/main.rs
Normal file
9
fuzz/src/main.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
use afl::fuzz;
|
||||
use hyperbuild::hyperbuild;
|
||||
|
||||
fn main() {
|
||||
fuzz!(|data: &[u8]| {
|
||||
let mut mut_data: Vec<u8> = data.iter().map(|x| *x).collect();
|
||||
hyperbuild(&mut mut_data);
|
||||
});
|
||||
}
|
||||
Reference in a new issue