glib/fuzzing
Philip Withnall b654eb1846 guri: Make G_URI_FLAGS_PARSE_STRICT the default
Make `G_URI_FLAGS_PARSE_RELAXED` available instead, for the
implementations which need to handle user-provided or incorrect URIs.
The default should nudge people towards being compliant with RFC 3986.

This required also adding a new `G_URI_PARAMS_PARSE_RELAXED` flag, as
previously parsing param strings *always* used relaxed mode and there
was no way to control it. Now it defaults to using strict mode, and the
new flag allows for relaxed mode to be enabled if needed.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #2149
2020-08-07 14:02:18 +01:00
..
driver.c Integrate oss-fuzz targets 2018-10-11 00:02:03 +00:00
fuzz_bookmark.c Integrate oss-fuzz targets 2018-10-11 00:02:03 +00:00
fuzz_bookmark.corpus Integrate oss-fuzz targets 2018-10-11 00:02:03 +00:00
fuzz_dbus_message.c Integrate oss-fuzz targets 2018-10-11 00:02:03 +00:00
fuzz_key.c Integrate oss-fuzz targets 2018-10-11 00:02:03 +00:00
fuzz_key.corpus Integrate oss-fuzz targets 2018-10-11 00:02:03 +00:00
fuzz_uri_escape.c uri: add a GError to the new g_uri_unescape_bytes() 2020-07-26 17:19:37 +04:00
fuzz_uri_parse_params.c uri: make g_uri_parse_params() take an error 2020-07-07 15:20:57 +04:00
fuzz_uri_parse.c guri: Make G_URI_FLAGS_PARSE_STRICT the default 2020-08-07 14:02:18 +01:00
fuzz_variant_binary.c Integrate oss-fuzz targets 2018-10-11 00:02:03 +00:00
fuzz_variant_text.c Integrate oss-fuzz targets 2018-10-11 00:02:03 +00:00
fuzz_variant_text.dict Integrate oss-fuzz targets 2018-10-11 00:02:03 +00:00
fuzz.h Integrate oss-fuzz targets 2018-10-11 00:02:03 +00:00
meson.build fuzzing: Add fuzz tests for GUri parsing and escaping 2020-06-25 13:57:35 +04:00
README.md Fix oss-fuzz coverage link 2020-02-15 08:23:25 +00:00

Fuzz targets used by oss-fuzz.

Useful links: Dashboard (requires access), Build logs, Coverage

How to add new targets

Add fuzz_target_name.c and edit meson.build accordingly.

New targets are picked up by oss-fuzz automatically within a day. Targets must not be renamed once added.

Add (optional) fuzz_target_name.dict containing keywords and magic bytes.

Add (optional) fuzz_target_name.corpus with file names on separate lines. Wildcards ?, * and ** are supported. Examples below.

glib/*  # all files in directory glib
glib/** # all files in directory glib and sub-directories
**.xbel # all files ending with .xbel in the repository

Recommended reading: Fuzz Target, Dictionaries, Corpus

How to reproduce oss-fuzz bugs locally

Build with at least the following flags, choosing a sanitizer as needed. A somewhat recent version of clang is recommended.

$ CC=clang CXX=clang++ meson DIR -Db_sanitize=<address|undefined> -Db_lundef=false

Afterwards run the affected target against the provided test case.

$ DIR/fuzzing/fuzz_target_name FILE

FAQs

What about Memory Sanitizer (MSAN)?

Correct MSAN instrumentation is difficult to achieve locally, so false positives are very likely to mask the actual bug.

If need be, you can still reproduce those bugs with the oss-fuzz provided docker images.

There are no file/function names in the stack trace.

llvm-symbolizer must be in PATH.

UndefinedBehavior Sanitizer (UBSAN) doesn't provide a stack trace.

Set environment variable UBSAN_OPTIONS to print_stacktrace=1 prior to running the target.