2020-08-17 02:54:28 +02:00
|
|
|
AUTOMAKE_OPTIONS = -Wno-syntax
|
2024-04-16 13:24:12 +02:00
|
|
|
EXTRA_PROGRAMS = genSeed \
|
2024-05-13 12:18:08 +02:00
|
|
|
api html lint reader regexp schema uri valid xinclude \
|
|
|
|
xml xpath
|
2020-06-05 12:49:25 +02:00
|
|
|
check_PROGRAMS = testFuzzer
|
2020-10-25 20:08:16 +01:00
|
|
|
EXTRA_DIST = html.dict regexp.dict schema.dict xml.dict xpath.dict \
|
2022-02-14 18:06:38 +01:00
|
|
|
static_seed/uri static_seed/regexp fuzz.h
|
2020-06-05 12:49:25 +02:00
|
|
|
CLEANFILES = $(EXTRA_PROGRAMS)
|
2022-02-14 18:06:38 +01:00
|
|
|
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include
|
2020-06-05 12:49:25 +02:00
|
|
|
DEPENDENCIES = $(top_builddir)/libxml2.la
|
2022-04-03 01:42:17 +02:00
|
|
|
LDADD = $(top_builddir)/libxml2.la
|
2020-06-05 12:49:25 +02:00
|
|
|
|
2020-07-12 22:59:39 +02:00
|
|
|
XML_MAX_LEN = 80000
|
2020-08-24 16:28:54 +02:00
|
|
|
# Single quotes to avoid wildcard expansion by the shell
|
2020-06-05 12:49:25 +02:00
|
|
|
XML_SEED_CORPUS_SRC = \
|
2020-08-24 16:28:54 +02:00
|
|
|
'$(top_srcdir)/test/*' \
|
|
|
|
'$(top_srcdir)/test/errors/*.xml' \
|
|
|
|
'$(top_srcdir)/test/errors10/*.xml' \
|
|
|
|
'$(top_srcdir)/test/namespaces/*' \
|
2022-12-26 17:58:33 +01:00
|
|
|
'$(top_srcdir)/test/recurse/*.xml' \
|
2022-04-03 21:39:14 +02:00
|
|
|
'$(top_srcdir)/test/SVG/*.xml' \
|
2020-08-24 16:28:54 +02:00
|
|
|
'$(top_srcdir)/test/valid/*.xml' \
|
|
|
|
'$(top_srcdir)/test/VC/*' \
|
|
|
|
'$(top_srcdir)/test/VCM/*' \
|
2024-04-24 22:52:06 +02:00
|
|
|
'$(top_srcdir)/test/XInclude/docs/*' \
|
|
|
|
'$(top_srcdir)/test/XInclude/without-reader/*' \
|
2020-08-24 16:28:54 +02:00
|
|
|
'$(top_srcdir)/test/xmlid/*'
|
2020-06-05 12:49:25 +02:00
|
|
|
|
2020-07-12 22:59:39 +02:00
|
|
|
testFuzzer_SOURCES = testFuzzer.c fuzz.c
|
|
|
|
|
2022-04-04 05:19:33 +02:00
|
|
|
.PHONY: corpus clean-corpus
|
2020-08-17 02:54:28 +02:00
|
|
|
|
2024-05-13 12:18:08 +02:00
|
|
|
corpus: seed/html.stamp seed/lint.stamp seed/reader.stamp seed/regexp.stamp \
|
|
|
|
seed/schema.stamp seed/uri.stamp seed/valid.stamp seed/xinclude.stamp \
|
|
|
|
seed/xml.stamp seed/xpath.stamp
|
2020-08-24 03:16:25 +02:00
|
|
|
|
2022-04-04 05:19:33 +02:00
|
|
|
check-local: corpus
|
|
|
|
./testFuzzer$(EXEEXT)
|
2020-07-12 22:59:39 +02:00
|
|
|
|
2020-08-17 02:54:28 +02:00
|
|
|
clean-corpus:
|
2022-02-14 18:06:38 +01:00
|
|
|
rm -rf seed
|
|
|
|
|
|
|
|
clean-local: clean-corpus
|
2020-08-17 02:54:28 +02:00
|
|
|
|
2020-08-24 16:28:54 +02:00
|
|
|
# Seed corpus
|
|
|
|
|
|
|
|
genSeed_SOURCES = genSeed.c fuzz.c
|
2020-07-12 22:59:39 +02:00
|
|
|
|
2020-08-24 16:28:54 +02:00
|
|
|
# XML fuzzer
|
2020-06-05 12:49:25 +02:00
|
|
|
|
2020-08-24 16:28:54 +02:00
|
|
|
seed/xml.stamp: genSeed$(EXEEXT)
|
2020-06-05 12:49:25 +02:00
|
|
|
@mkdir -p seed/xml
|
2022-02-14 18:06:38 +01:00
|
|
|
./genSeed$(EXEEXT) xml $(XML_SEED_CORPUS_SRC)
|
2020-06-05 12:49:25 +02:00
|
|
|
@touch seed/xml.stamp
|
|
|
|
|
|
|
|
xml_SOURCES = xml.c fuzz.c
|
2022-09-02 16:45:06 +02:00
|
|
|
xml_LDFLAGS = $(AM_LDFLAGS) -fsanitize=fuzzer
|
2020-06-05 12:49:25 +02:00
|
|
|
|
|
|
|
fuzz-xml: xml$(EXEEXT) seed/xml.stamp
|
|
|
|
@mkdir -p corpus/xml
|
|
|
|
./xml$(EXEEXT) \
|
|
|
|
-dict=xml.dict \
|
2020-07-12 22:59:39 +02:00
|
|
|
-max_len=$(XML_MAX_LEN) \
|
2024-03-16 15:10:32 +01:00
|
|
|
$$XML_FUZZ_OPTIONS \
|
2020-06-05 12:49:25 +02:00
|
|
|
corpus/xml seed/xml
|
|
|
|
|
2023-03-12 16:15:54 +01:00
|
|
|
# DTD validation fuzzer
|
|
|
|
|
|
|
|
seed/valid.stamp: genSeed$(EXEEXT)
|
|
|
|
@mkdir -p seed/valid
|
|
|
|
./genSeed$(EXEEXT) valid $(XML_SEED_CORPUS_SRC)
|
|
|
|
@touch seed/valid.stamp
|
|
|
|
|
|
|
|
valid_SOURCES = valid.c fuzz.c
|
|
|
|
valid_LDFLAGS = $(AM_LDFLAGS) -fsanitize=fuzzer
|
|
|
|
|
|
|
|
fuzz-valid: valid$(EXEEXT) seed/valid.stamp
|
|
|
|
@mkdir -p corpus/valid
|
|
|
|
./valid$(EXEEXT) \
|
|
|
|
-dict=xml.dict \
|
|
|
|
-max_len=$(XML_MAX_LEN) \
|
2024-03-16 15:10:32 +01:00
|
|
|
$$XML_FUZZ_OPTIONS \
|
2023-03-12 16:15:54 +01:00
|
|
|
corpus/valid seed/valid
|
|
|
|
|
2022-12-26 17:49:27 +01:00
|
|
|
# XInclude fuzzer
|
|
|
|
|
|
|
|
seed/xinclude.stamp: genSeed$(EXEEXT)
|
|
|
|
@mkdir -p seed/xinclude
|
2024-04-24 22:52:06 +02:00
|
|
|
./genSeed$(EXEEXT) xinclude $(XML_SEED_CORPUS_SRC)
|
2022-12-26 17:49:27 +01:00
|
|
|
@touch seed/xinclude.stamp
|
|
|
|
|
|
|
|
xinclude_SOURCES = xinclude.c fuzz.c
|
|
|
|
xinclude_LDFLAGS = $(AM_LDFLAGS) -fsanitize=fuzzer
|
|
|
|
|
|
|
|
fuzz-xinclude: xinclude$(EXEEXT) seed/xinclude.stamp
|
|
|
|
@mkdir -p corpus/xinclude
|
|
|
|
./xinclude$(EXEEXT) \
|
|
|
|
-dict=xml.dict \
|
|
|
|
-max_len=$(XML_MAX_LEN) \
|
2024-03-16 15:10:32 +01:00
|
|
|
$$XML_FUZZ_OPTIONS \
|
2022-12-26 17:49:27 +01:00
|
|
|
corpus/xinclude seed/xinclude
|
|
|
|
|
2020-07-12 22:59:39 +02:00
|
|
|
# HTML fuzzer
|
|
|
|
|
2020-08-24 16:28:54 +02:00
|
|
|
seed/html.stamp: genSeed$(EXEEXT)
|
2020-07-12 22:59:39 +02:00
|
|
|
@mkdir -p seed/html
|
2022-02-14 18:06:38 +01:00
|
|
|
./genSeed$(EXEEXT) html '$(top_srcdir)/test/HTML/*'
|
2020-07-12 22:59:39 +02:00
|
|
|
@touch seed/html.stamp
|
|
|
|
|
2020-06-15 12:20:54 +02:00
|
|
|
html_SOURCES = html.c fuzz.c
|
2022-09-02 16:45:06 +02:00
|
|
|
html_LDFLAGS = $(AM_LDFLAGS) -fsanitize=fuzzer
|
2020-06-15 12:20:54 +02:00
|
|
|
|
2020-07-12 22:59:39 +02:00
|
|
|
fuzz-html: html$(EXEEXT) seed/html.stamp
|
2020-06-15 12:20:54 +02:00
|
|
|
@mkdir -p corpus/html
|
|
|
|
./html$(EXEEXT) \
|
|
|
|
-dict=html.dict \
|
|
|
|
-max_len=1000000 \
|
2024-03-16 15:10:32 +01:00
|
|
|
$$XML_FUZZ_OPTIONS \
|
2020-07-12 22:59:39 +02:00
|
|
|
corpus/html seed/html
|
|
|
|
|
2024-04-16 13:24:12 +02:00
|
|
|
# Reader fuzzer
|
|
|
|
|
|
|
|
seed/reader.stamp: genSeed$(EXEEXT)
|
|
|
|
@mkdir -p seed/reader
|
2024-04-24 22:52:06 +02:00
|
|
|
./genSeed$(EXEEXT) reader $(XML_SEED_CORPUS_SRC)
|
2024-04-16 13:24:12 +02:00
|
|
|
@touch seed/reader.stamp
|
|
|
|
|
|
|
|
reader_SOURCES = reader.c fuzz.c
|
|
|
|
reader_LDFLAGS = $(AM_LDFLAGS) -fsanitize=fuzzer
|
|
|
|
|
|
|
|
fuzz-reader: reader$(EXEEXT) seed/reader.stamp
|
|
|
|
@mkdir -p corpus/reader
|
|
|
|
./reader$(EXEEXT) \
|
|
|
|
-dict=xml.dict \
|
|
|
|
-max_len=$(XML_MAX_LEN) \
|
|
|
|
$$XML_FUZZ_OPTIONS \
|
|
|
|
corpus/reader seed/reader
|
|
|
|
|
2024-05-13 12:18:08 +02:00
|
|
|
# xmllint fuzzer
|
|
|
|
|
|
|
|
seed/lint.stamp: genSeed$(EXEEXT)
|
|
|
|
@mkdir -p seed/lint
|
|
|
|
./genSeed$(EXEEXT) lint $(XML_SEED_CORPUS_SRC)
|
|
|
|
@touch seed/lint.stamp
|
|
|
|
|
2025-01-17 17:09:04 +01:00
|
|
|
lint_SOURCES = lint.c fuzz.c ../xmllint.c ../shell.c
|
2024-05-13 12:18:08 +02:00
|
|
|
lint_LDFLAGS = -fsanitize=fuzzer
|
|
|
|
|
|
|
|
fuzz-lint: lint$(EXEEXT) seed/lint.stamp
|
|
|
|
@mkdir -p corpus/lint
|
|
|
|
./lint$(EXEEXT) \
|
|
|
|
-dict=xml.dict \
|
|
|
|
-max_len=$(XML_MAX_LEN) \
|
|
|
|
$$XML_FUZZ_OPTIONS \
|
|
|
|
corpus/lint seed/lint
|
|
|
|
|
2024-02-29 14:51:49 +01:00
|
|
|
# API fuzzer
|
|
|
|
|
|
|
|
api_SOURCES = api.c fuzz.c
|
|
|
|
api_LDFLAGS = -fsanitize=fuzzer
|
|
|
|
|
|
|
|
fuzz-api: api$(EXEEXT)
|
|
|
|
@mkdir -p corpus/api
|
|
|
|
./api$(EXEEXT) \
|
|
|
|
-max_len=100 \
|
2024-03-16 15:10:32 +01:00
|
|
|
$$XML_FUZZ_OPTIONS \
|
2024-02-29 14:51:49 +01:00
|
|
|
corpus/api
|
|
|
|
|
2020-07-12 22:59:39 +02:00
|
|
|
# Regexp fuzzer
|
2020-06-15 12:20:54 +02:00
|
|
|
|
2022-02-14 18:06:38 +01:00
|
|
|
seed/regexp.stamp:
|
|
|
|
@mkdir -p seed/regexp
|
|
|
|
cp -r $(srcdir)/static_seed/regexp seed
|
|
|
|
@touch seed/regexp.stamp
|
|
|
|
|
2020-06-05 12:49:25 +02:00
|
|
|
regexp_SOURCES = regexp.c fuzz.c
|
2022-09-02 16:45:06 +02:00
|
|
|
regexp_LDFLAGS = $(AM_LDFLAGS) -fsanitize=fuzzer
|
2020-06-05 12:49:25 +02:00
|
|
|
|
2023-02-17 14:54:13 +01:00
|
|
|
fuzz-regexp: regexp$(EXEEXT) seed/regexp.stamp
|
2020-06-05 12:49:25 +02:00
|
|
|
@mkdir -p corpus/regexp
|
|
|
|
./regexp$(EXEEXT) \
|
|
|
|
-dict=regexp.dict \
|
2020-07-12 22:59:39 +02:00
|
|
|
-max_len=200 \
|
2024-03-16 15:10:32 +01:00
|
|
|
$$XML_FUZZ_OPTIONS \
|
2022-02-14 18:06:38 +01:00
|
|
|
corpus/regexp seed/regexp
|
2020-06-05 12:49:25 +02:00
|
|
|
|
2020-07-12 22:59:39 +02:00
|
|
|
# URI fuzzer
|
|
|
|
|
2022-02-14 18:06:38 +01:00
|
|
|
seed/uri.stamp:
|
|
|
|
@mkdir -p seed/uri
|
|
|
|
cp -r $(srcdir)/static_seed/uri seed
|
|
|
|
@touch seed/uri.stamp
|
|
|
|
|
2020-06-05 12:49:25 +02:00
|
|
|
uri_SOURCES = uri.c fuzz.c
|
2022-09-02 16:45:06 +02:00
|
|
|
uri_LDFLAGS = $(AM_LDFLAGS) -fsanitize=fuzzer
|
2020-06-05 12:49:25 +02:00
|
|
|
|
2023-02-17 14:54:13 +01:00
|
|
|
fuzz-uri: uri$(EXEEXT) seed/uri.stamp
|
2020-06-05 12:49:25 +02:00
|
|
|
@mkdir -p corpus/uri
|
|
|
|
./uri$(EXEEXT) \
|
|
|
|
-max_len=10000 \
|
2024-03-16 15:10:32 +01:00
|
|
|
$$XML_FUZZ_OPTIONS \
|
2022-02-14 18:06:38 +01:00
|
|
|
corpus/uri seed/uri
|
2020-06-05 12:49:25 +02:00
|
|
|
|
2020-07-12 22:59:39 +02:00
|
|
|
# XML Schema fuzzer
|
|
|
|
|
2020-08-24 16:28:54 +02:00
|
|
|
seed/schema.stamp: genSeed$(EXEEXT)
|
2020-06-21 14:42:00 +02:00
|
|
|
@mkdir -p seed/schema
|
2022-02-14 18:06:38 +01:00
|
|
|
./genSeed$(EXEEXT) schema '$(top_srcdir)/test/schemas/*.xsd'
|
2020-06-21 14:42:00 +02:00
|
|
|
@touch seed/schema.stamp
|
|
|
|
|
|
|
|
schema_SOURCES = schema.c fuzz.c
|
2022-09-02 16:45:06 +02:00
|
|
|
schema_LDFLAGS = $(AM_LDFLAGS) -fsanitize=fuzzer
|
2020-06-21 14:42:00 +02:00
|
|
|
|
|
|
|
fuzz-schema: schema$(EXEEXT) seed/schema.stamp
|
|
|
|
@mkdir -p corpus/schema
|
|
|
|
./schema$(EXEEXT) \
|
|
|
|
-dict=schema.dict \
|
2020-07-12 22:59:39 +02:00
|
|
|
-max_len=$(XML_MAX_LEN) \
|
2024-03-16 15:10:32 +01:00
|
|
|
$$XML_FUZZ_OPTIONS \
|
2020-06-21 14:42:00 +02:00
|
|
|
corpus/schema seed/schema
|
|
|
|
|
2020-08-06 13:20:01 +02:00
|
|
|
# XPath fuzzer
|
|
|
|
|
2020-08-24 16:28:54 +02:00
|
|
|
seed/xpath.stamp: genSeed$(EXEEXT)
|
2020-08-06 13:20:01 +02:00
|
|
|
@mkdir -p seed/xpath
|
2022-02-14 18:06:38 +01:00
|
|
|
./genSeed$(EXEEXT) xpath '$(top_srcdir)/test/XPath'
|
2020-08-06 13:20:01 +02:00
|
|
|
@touch seed/xpath.stamp
|
|
|
|
|
|
|
|
xpath_SOURCES = xpath.c fuzz.c
|
2022-09-02 16:45:06 +02:00
|
|
|
xpath_LDFLAGS = $(AM_LDFLAGS) -fsanitize=fuzzer
|
2020-08-06 13:20:01 +02:00
|
|
|
|
|
|
|
fuzz-xpath: xpath$(EXEEXT) seed/xpath.stamp
|
|
|
|
@mkdir -p corpus/xpath
|
|
|
|
./xpath$(EXEEXT) \
|
|
|
|
-dict=xpath.dict \
|
|
|
|
-max_len=10000 \
|
2024-03-16 15:10:32 +01:00
|
|
|
$$XML_FUZZ_OPTIONS \
|
2020-08-06 13:20:01 +02:00
|
|
|
corpus/xpath seed/xpath
|
|
|
|
|