Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Quality assurance testing for the curl project

License

NotificationsYou must be signed in to change notification settings

curl/curl-fuzzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code and corpora for curl and libcurl fuzzing.

This is the curl fuzzingOSS-Fuzz runs for us, non-stop.

I just want to get fuzzing!

Great! Run./mainline.sh. It will download you a fresh copy of curl, compileit withclang, install it to a temporary directory, then compile the fuzzeragainst curl. It'll also run the regression testcases.

If you have a local copy of curl that you want to use instead, pass the path asan argument to./mainline.sh. It will compile and install that curl to atemporary directory instead.

./mainline.sh is run regressibly by Github Actions.

I want more information when running a testcase or multiple testcases

Setting theFUZZ_VERBOSE environment variable turns on curl verbose logging.This can be useful when debugging a single testcase.

I want to download public corpus test files from OSS-Fuzz

The public corpus links for each target should be accessible here:

I want to reproduce an error hit overnight by OSS-Fuzz

Check outREPRODUCING.md for more detailed instructions.

How do I install the Python tooling?

  • Create a virtual environment using your favourite method.
    • For example:
      python3 -m venv .venv
  • Within that virtual environment, from the root directory of this repository, install the tooling with
    pip install.
  • Alternatively you can useuv; either
    uv syncuv pip install -e.
    to sync your environment, or
    uv run<tool>
    directly.

What's in this testcase?

To look at the contents of a testcase, run

read_corpus<path/to/file>

This will print out a list of contents inside the file.

I want to generate a new testcase

To generate a new testcase, run

generate_corpus

with appropriate options - pass--help for all options.

I want to enhance the fuzzer!

Wonderful! Here's a bit of information you may need to know.

File format

Testcases are written in a Type-Length-Value or TLV format. Each TLV has:

  • 16 bits for the Type
  • 32 bits for the Length of the TLV data
  • 0 - length bytes of data.

TLV type numbers are defined in both corpus.py and curl_fuzzer.h.

Adding a new TLV.

To add a new TLV:

  • Add support for it in the Python scripts:generate_corpus.py,corpus.py.This means adding options for reading the value of the TLV from the user (orfrom a file, or from test data)
  • Add support for it in the fuzzer:curl_fuzzer.cc,curl_fuzzer.h. Thislikely means adding handling of the TLV tofuzz_parse_tlv().
  • Ensure thatFUZZ_CURLOPT_TRACKER_SPACE can encompass your additional TLVs!
  • If you decide to change a TLV number after you have created it and havegenerated test cases before you changed the TLV, rerun the test casegeneration to ensure your current TLV numbering maps your test cases as youexpect.

About

Quality assurance testing for the curl project

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp