Skip to content

Commit

Permalink
Add trophy case and improved harness example to README
Browse files Browse the repository at this point in the history
  • Loading branch information
mschwager committed Mar 25, 2024
1 parent fbd393b commit 0f554e6
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Table of contents:
- [Getting started](#getting-started)
- [Fuzzing pure Ruby code](#fuzzing-pure-ruby-code)
- [Fuzzing Ruby C extensions](#fuzzing-ruby-c-extensions)
- [Trophy case](#trophy-case)
- [Developing](#developing)
- [Compiling](#compiling)
- [Testing](#testing)
Expand Down Expand Up @@ -131,18 +132,22 @@ Next, the fuzzing harness, let's call it `test_harness.rb`:

require 'ruzzy'

test_one_input = lambda do |data|
if data.length == 4
if data[0] == 'F'
if data[1] == 'U'
if data[2] == 'Z'
if data[3] == 'Z'
def fuzzing_target(input)
if input.length == 4
if input[0] == 'F'
if input[1] == 'U'
if input[2] == 'Z'
if input[3] == 'Z'
raise
end
end
end
end
end
end

test_one_input = lambda do |data|
fuzzing_target(data) # Your fuzzing target would go here
return 0
end

Expand Down Expand Up @@ -236,6 +241,13 @@ See [libFuzzer options](https://llvm.org/docs/LibFuzzer.html#options) for more i

To fuzz your own target, modify the `test_one_input` `lambda` to call your target function.

# Trophy case

Bugs found using Ruzzy:

- Ruby `toml` gem: [#76](https://github.com/jm/toml/issues/76)
- Ruby `toml-rb` gem: [#150](https://github.com/emancu/toml-rb/issues/150)

# Developing

Development can be done locally, or using the `Dockerfile` provided in this repository.
Expand Down

0 comments on commit 0f554e6

Please sign in to comment.