Kitxuuu commited on
Commit
6aaf86c
·
verified ·
1 Parent(s): d843a8a

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. local-test-libxml2-full-01/afc-libxml2/fuzz/.gitignore +15 -0
  2. local-test-libxml2-full-01/afc-libxml2/fuzz/Makefile.am +239 -0
  3. local-test-libxml2-full-01/afc-libxml2/fuzz/README.md +47 -0
  4. local-test-libxml2-full-01/afc-libxml2/fuzz/api.c +0 -0
  5. local-test-libxml2-full-01/afc-libxml2/fuzz/api.options +2 -0
  6. local-test-libxml2-full-01/afc-libxml2/fuzz/fuzz.c +500 -0
  7. local-test-libxml2-full-01/afc-libxml2/fuzz/fuzz.h +133 -0
  8. local-test-libxml2-full-01/afc-libxml2/fuzz/genSeed.c +514 -0
  9. local-test-libxml2-full-01/afc-libxml2/fuzz/html.c +125 -0
  10. local-test-libxml2-full-01/afc-libxml2/fuzz/html.dict +124 -0
  11. local-test-libxml2-full-01/afc-libxml2/fuzz/html.options +2 -0
  12. local-test-libxml2-full-01/afc-libxml2/fuzz/lint.c +213 -0
  13. local-test-libxml2-full-01/afc-libxml2/fuzz/lint.options +2 -0
  14. local-test-libxml2-full-01/afc-libxml2/fuzz/oss-fuzz-build.sh +58 -0
  15. local-test-libxml2-full-01/afc-libxml2/fuzz/reader.c +555 -0
  16. local-test-libxml2-full-01/afc-libxml2/fuzz/reader.options +3 -0
  17. local-test-libxml2-full-01/afc-libxml2/fuzz/regexp.c +51 -0
  18. local-test-libxml2-full-01/afc-libxml2/fuzz/regexp.dict +155 -0
  19. local-test-libxml2-full-01/afc-libxml2/fuzz/regexp.options +2 -0
  20. local-test-libxml2-full-01/afc-libxml2/fuzz/schema.c +50 -0
  21. local-test-libxml2-full-01/afc-libxml2/fuzz/schema.dict +55 -0
  22. local-test-libxml2-full-01/afc-libxml2/fuzz/schema.options +2 -0
  23. local-test-libxml2-full-01/afc-libxml2/fuzz/testFuzzer.c +249 -0
  24. local-test-libxml2-full-01/afc-libxml2/fuzz/uri.c +104 -0
  25. local-test-libxml2-full-01/afc-libxml2/fuzz/uri.options +2 -0
  26. local-test-libxml2-full-01/afc-libxml2/fuzz/valid.c +127 -0
  27. local-test-libxml2-full-01/afc-libxml2/fuzz/valid.options +3 -0
  28. local-test-libxml2-full-01/afc-libxml2/fuzz/xinclude.c +91 -0
  29. local-test-libxml2-full-01/afc-libxml2/fuzz/xinclude.options +3 -0
  30. local-test-libxml2-full-01/afc-libxml2/fuzz/xml.c +140 -0
  31. local-test-libxml2-full-01/afc-libxml2/fuzz/xml.dict +121 -0
  32. local-test-libxml2-full-01/afc-libxml2/fuzz/xml.options +2 -0
  33. local-test-libxml2-full-01/afc-libxml2/fuzz/xpath.c +74 -0
  34. local-test-libxml2-full-01/afc-libxml2/fuzz/xpath.dict +94 -0
  35. local-test-libxml2-full-01/afc-libxml2/fuzz/xpath.options +2 -0
  36. local-test-libxml2-full-01/afc-libxml2/result/dav1 +25 -0
  37. local-test-libxml2-full-01/afc-libxml2/result/ent10.rde +14 -0
  38. local-test-libxml2-full-01/afc-libxml2/result/eve.xml.sax +11 -0
  39. local-test-libxml2-full-01/afc-libxml2/result/pi2.xml.rde +9 -0
  40. local-test-libxml2-full-01/afc-libxml2/result/svg3.rde +2164 -0
  41. local-test-libxml2-full-01/afc-libxml2/result/xml1.rde +8 -0
  42. local-test-libxml2-full-01/afc-libxml2/test/HTML/53867.html +69 -0
  43. local-test-libxml2-full-01/afc-libxml2/test/HTML/758518-entity.html +1 -0
  44. local-test-libxml2-full-01/afc-libxml2/test/HTML/758518-tag.html +1 -0
  45. local-test-libxml2-full-01/afc-libxml2/test/HTML/758605.html +1 -0
  46. local-test-libxml2-full-01/afc-libxml2/test/HTML/758606.html +1 -0
  47. local-test-libxml2-full-01/afc-libxml2/test/HTML/758606_2.html +1 -0
  48. local-test-libxml2-full-01/afc-libxml2/test/HTML/Down.html +12 -0
  49. local-test-libxml2-full-01/afc-libxml2/test/HTML/attr-ents.html +7 -0
  50. local-test-libxml2-full-01/afc-libxml2/test/HTML/attrents.html +5 -0
local-test-libxml2-full-01/afc-libxml2/fuzz/.gitignore ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ api
2
+ corpus/
3
+ genSeed
4
+ html
5
+ lint
6
+ reader
7
+ regexp
8
+ schema
9
+ seed/
10
+ testFuzzer
11
+ uri
12
+ valid
13
+ xinclude
14
+ xml
15
+ xpath
local-test-libxml2-full-01/afc-libxml2/fuzz/Makefile.am ADDED
@@ -0,0 +1,239 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ AUTOMAKE_OPTIONS = -Wno-syntax
2
+ EXTRA_PROGRAMS = genSeed \
3
+ api html lint reader regexp schema uri valid xinclude \
4
+ xml xpath
5
+ check_PROGRAMS = testFuzzer
6
+ EXTRA_DIST = html.dict regexp.dict schema.dict xml.dict xpath.dict \
7
+ static_seed/uri static_seed/regexp fuzz.h
8
+ CLEANFILES = $(EXTRA_PROGRAMS)
9
+ AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include
10
+ DEPENDENCIES = $(top_builddir)/libxml2.la
11
+ LDADD = $(top_builddir)/libxml2.la
12
+
13
+ XML_MAX_LEN = 80000
14
+ # Single quotes to avoid wildcard expansion by the shell
15
+ XML_SEED_CORPUS_SRC = \
16
+ '$(top_srcdir)/test/*' \
17
+ '$(top_srcdir)/test/errors/*.xml' \
18
+ '$(top_srcdir)/test/errors10/*.xml' \
19
+ '$(top_srcdir)/test/namespaces/*' \
20
+ '$(top_srcdir)/test/recurse/*.xml' \
21
+ '$(top_srcdir)/test/SVG/*.xml' \
22
+ '$(top_srcdir)/test/valid/*.xml' \
23
+ '$(top_srcdir)/test/VC/*' \
24
+ '$(top_srcdir)/test/VCM/*' \
25
+ '$(top_srcdir)/test/XInclude/docs/*' \
26
+ '$(top_srcdir)/test/XInclude/without-reader/*' \
27
+ '$(top_srcdir)/test/xmlid/*'
28
+
29
+ testFuzzer_SOURCES = testFuzzer.c fuzz.c
30
+
31
+ .PHONY: corpus clean-corpus
32
+
33
+ corpus: seed/html.stamp seed/lint.stamp seed/reader.stamp seed/regexp.stamp \
34
+ seed/schema.stamp seed/uri.stamp seed/valid.stamp seed/xinclude.stamp \
35
+ seed/xml.stamp seed/xpath.stamp
36
+
37
+ check-local: corpus
38
+ ./testFuzzer$(EXEEXT)
39
+
40
+ clean-corpus:
41
+ rm -rf seed
42
+
43
+ clean-local: clean-corpus
44
+
45
+ # Seed corpus
46
+
47
+ genSeed_SOURCES = genSeed.c fuzz.c
48
+
49
+ # XML fuzzer
50
+
51
+ seed/xml.stamp: genSeed$(EXEEXT)
52
+ @mkdir -p seed/xml
53
+ ./genSeed$(EXEEXT) xml $(XML_SEED_CORPUS_SRC)
54
+ @touch seed/xml.stamp
55
+
56
+ xml_SOURCES = xml.c fuzz.c
57
+ xml_LDFLAGS = $(AM_LDFLAGS) -fsanitize=fuzzer
58
+
59
+ fuzz-xml: xml$(EXEEXT) seed/xml.stamp
60
+ @mkdir -p corpus/xml
61
+ ./xml$(EXEEXT) \
62
+ -dict=xml.dict \
63
+ -max_len=$(XML_MAX_LEN) \
64
+ $$XML_FUZZ_OPTIONS \
65
+ corpus/xml seed/xml
66
+
67
+ # DTD validation fuzzer
68
+
69
+ seed/valid.stamp: genSeed$(EXEEXT)
70
+ @mkdir -p seed/valid
71
+ ./genSeed$(EXEEXT) valid $(XML_SEED_CORPUS_SRC)
72
+ @touch seed/valid.stamp
73
+
74
+ valid_SOURCES = valid.c fuzz.c
75
+ valid_LDFLAGS = $(AM_LDFLAGS) -fsanitize=fuzzer
76
+
77
+ fuzz-valid: valid$(EXEEXT) seed/valid.stamp
78
+ @mkdir -p corpus/valid
79
+ ./valid$(EXEEXT) \
80
+ -dict=xml.dict \
81
+ -max_len=$(XML_MAX_LEN) \
82
+ $$XML_FUZZ_OPTIONS \
83
+ corpus/valid seed/valid
84
+
85
+ # XInclude fuzzer
86
+
87
+ seed/xinclude.stamp: genSeed$(EXEEXT)
88
+ @mkdir -p seed/xinclude
89
+ ./genSeed$(EXEEXT) xinclude $(XML_SEED_CORPUS_SRC)
90
+ @touch seed/xinclude.stamp
91
+
92
+ xinclude_SOURCES = xinclude.c fuzz.c
93
+ xinclude_LDFLAGS = $(AM_LDFLAGS) -fsanitize=fuzzer
94
+
95
+ fuzz-xinclude: xinclude$(EXEEXT) seed/xinclude.stamp
96
+ @mkdir -p corpus/xinclude
97
+ ./xinclude$(EXEEXT) \
98
+ -dict=xml.dict \
99
+ -max_len=$(XML_MAX_LEN) \
100
+ $$XML_FUZZ_OPTIONS \
101
+ corpus/xinclude seed/xinclude
102
+
103
+ # HTML fuzzer
104
+
105
+ seed/html.stamp: genSeed$(EXEEXT)
106
+ @mkdir -p seed/html
107
+ ./genSeed$(EXEEXT) html '$(top_srcdir)/test/HTML/*'
108
+ @touch seed/html.stamp
109
+
110
+ html_SOURCES = html.c fuzz.c
111
+ html_LDFLAGS = $(AM_LDFLAGS) -fsanitize=fuzzer
112
+
113
+ fuzz-html: html$(EXEEXT) seed/html.stamp
114
+ @mkdir -p corpus/html
115
+ ./html$(EXEEXT) \
116
+ -dict=html.dict \
117
+ -max_len=1000000 \
118
+ $$XML_FUZZ_OPTIONS \
119
+ corpus/html seed/html
120
+
121
+ # Reader fuzzer
122
+
123
+ seed/reader.stamp: genSeed$(EXEEXT)
124
+ @mkdir -p seed/reader
125
+ ./genSeed$(EXEEXT) reader $(XML_SEED_CORPUS_SRC)
126
+ @touch seed/reader.stamp
127
+
128
+ reader_SOURCES = reader.c fuzz.c
129
+ reader_LDFLAGS = $(AM_LDFLAGS) -fsanitize=fuzzer
130
+
131
+ fuzz-reader: reader$(EXEEXT) seed/reader.stamp
132
+ @mkdir -p corpus/reader
133
+ ./reader$(EXEEXT) \
134
+ -dict=xml.dict \
135
+ -max_len=$(XML_MAX_LEN) \
136
+ $$XML_FUZZ_OPTIONS \
137
+ corpus/reader seed/reader
138
+
139
+ # xmllint fuzzer
140
+
141
+ seed/lint.stamp: genSeed$(EXEEXT)
142
+ @mkdir -p seed/lint
143
+ ./genSeed$(EXEEXT) lint $(XML_SEED_CORPUS_SRC)
144
+ @touch seed/lint.stamp
145
+
146
+ lint_SOURCES = lint.c fuzz.c
147
+ lint_LDFLAGS = -fsanitize=fuzzer
148
+
149
+ fuzz-lint: lint$(EXEEXT) seed/lint.stamp
150
+ @mkdir -p corpus/lint
151
+ ./lint$(EXEEXT) \
152
+ -dict=xml.dict \
153
+ -max_len=$(XML_MAX_LEN) \
154
+ $$XML_FUZZ_OPTIONS \
155
+ corpus/lint seed/lint
156
+
157
+ # API fuzzer
158
+
159
+ api_SOURCES = api.c fuzz.c
160
+ api_LDFLAGS = -fsanitize=fuzzer
161
+
162
+ fuzz-api: api$(EXEEXT)
163
+ @mkdir -p corpus/api
164
+ ./api$(EXEEXT) \
165
+ -max_len=100 \
166
+ $$XML_FUZZ_OPTIONS \
167
+ corpus/api
168
+
169
+ # Regexp fuzzer
170
+
171
+ seed/regexp.stamp:
172
+ @mkdir -p seed/regexp
173
+ cp -r $(srcdir)/static_seed/regexp seed
174
+ @touch seed/regexp.stamp
175
+
176
+ regexp_SOURCES = regexp.c fuzz.c
177
+ regexp_LDFLAGS = $(AM_LDFLAGS) -fsanitize=fuzzer
178
+
179
+ fuzz-regexp: regexp$(EXEEXT) seed/regexp.stamp
180
+ @mkdir -p corpus/regexp
181
+ ./regexp$(EXEEXT) \
182
+ -dict=regexp.dict \
183
+ -max_len=200 \
184
+ $$XML_FUZZ_OPTIONS \
185
+ corpus/regexp seed/regexp
186
+
187
+ # URI fuzzer
188
+
189
+ seed/uri.stamp:
190
+ @mkdir -p seed/uri
191
+ cp -r $(srcdir)/static_seed/uri seed
192
+ @touch seed/uri.stamp
193
+
194
+ uri_SOURCES = uri.c fuzz.c
195
+ uri_LDFLAGS = $(AM_LDFLAGS) -fsanitize=fuzzer
196
+
197
+ fuzz-uri: uri$(EXEEXT) seed/uri.stamp
198
+ @mkdir -p corpus/uri
199
+ ./uri$(EXEEXT) \
200
+ -max_len=10000 \
201
+ $$XML_FUZZ_OPTIONS \
202
+ corpus/uri seed/uri
203
+
204
+ # XML Schema fuzzer
205
+
206
+ seed/schema.stamp: genSeed$(EXEEXT)
207
+ @mkdir -p seed/schema
208
+ ./genSeed$(EXEEXT) schema '$(top_srcdir)/test/schemas/*.xsd'
209
+ @touch seed/schema.stamp
210
+
211
+ schema_SOURCES = schema.c fuzz.c
212
+ schema_LDFLAGS = $(AM_LDFLAGS) -fsanitize=fuzzer
213
+
214
+ fuzz-schema: schema$(EXEEXT) seed/schema.stamp
215
+ @mkdir -p corpus/schema
216
+ ./schema$(EXEEXT) \
217
+ -dict=schema.dict \
218
+ -max_len=$(XML_MAX_LEN) \
219
+ $$XML_FUZZ_OPTIONS \
220
+ corpus/schema seed/schema
221
+
222
+ # XPath fuzzer
223
+
224
+ seed/xpath.stamp: genSeed$(EXEEXT)
225
+ @mkdir -p seed/xpath
226
+ ./genSeed$(EXEEXT) xpath '$(top_srcdir)/test/XPath'
227
+ @touch seed/xpath.stamp
228
+
229
+ xpath_SOURCES = xpath.c fuzz.c
230
+ xpath_LDFLAGS = $(AM_LDFLAGS) -fsanitize=fuzzer
231
+
232
+ fuzz-xpath: xpath$(EXEEXT) seed/xpath.stamp
233
+ @mkdir -p corpus/xpath
234
+ ./xpath$(EXEEXT) \
235
+ -dict=xpath.dict \
236
+ -max_len=10000 \
237
+ $$XML_FUZZ_OPTIONS \
238
+ corpus/xpath seed/xpath
239
+
local-test-libxml2-full-01/afc-libxml2/fuzz/README.md ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ libFuzzer instructions for libxml2
2
+ ==================================
3
+
4
+ Set compiler and options. Make sure to enable at least basic optimizations
5
+ to avoid excessive stack usage. Also enable some debug output to get
6
+ meaningful stack traces.
7
+
8
+ export CC=clang
9
+ export CFLAGS=" \
10
+ -O1 -gline-tables-only \
11
+ -fsanitize=fuzzer-no-link,address,undefined \
12
+ -fno-sanitize-recover=all \
13
+ -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION"
14
+
15
+ Other options that can improve stack traces:
16
+
17
+ -fno-omit-frame-pointer
18
+ -fno-inline
19
+ -fno-optimize-sibling-calls (disables tail call optimization)
20
+
21
+ Build libxml2 with instrumentation:
22
+
23
+ ./configure --without-python
24
+ make
25
+
26
+ Run fuzzers:
27
+
28
+ make -C fuzz fuzz-xml
29
+
30
+ The environment variable XML_FUZZ_OPTIONS can be used to pass additional
31
+ flags to the fuzzer.
32
+
33
+ Malloc failure injection
34
+ ------------------------
35
+
36
+ Most fuzzers inject malloc failures to cover code paths handling these
37
+ errors. This can lead to surprises when debugging crashes. You can set
38
+ the macro XML_FUZZ_MALLOC_ABORT in fuzz/fuzz.c to make the fuzz target
39
+ abort at the malloc invocation which would fail. This tells you if
40
+ and where a malloc failure was injected.
41
+
42
+ Some fuzzers also test whether malloc failures are reported. To debug
43
+ failures which aren't reported, it's helpful to enable
44
+ XML_FUZZ_MALLOC_ABORT to see which allocation failed. Debugging
45
+ failures which are erroneously reported can be harder. If the report
46
+ goes through xmlRaiseMemoryError, you can abort() there to get a
47
+ stack trace.
local-test-libxml2-full-01/afc-libxml2/fuzz/api.c ADDED
The diff for this file is too large to render. See raw diff
 
local-test-libxml2-full-01/afc-libxml2/fuzz/api.options ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ [libfuzzer]
2
+ timeout_exitcode=0
local-test-libxml2-full-01/afc-libxml2/fuzz/fuzz.c ADDED
@@ -0,0 +1,500 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * fuzz.c: Common functions for fuzzing.
3
+ *
4
+ * See Copyright for the status of this software.
5
+ */
6
+
7
+ #include <stdio.h>
8
+ #include <stdlib.h>
9
+ #include <string.h>
10
+ #include <sys/stat.h>
11
+
12
+ #include <libxml/hash.h>
13
+ #include <libxml/parser.h>
14
+ #include <libxml/parserInternals.h>
15
+ #include <libxml/tree.h>
16
+ #include <libxml/xmlIO.h>
17
+ #include "fuzz.h"
18
+
19
+ typedef struct {
20
+ const char *data;
21
+ size_t size;
22
+ } xmlFuzzEntityInfo;
23
+
24
+ /* Single static instance for now */
25
+ static struct {
26
+ /* Original data */
27
+ const char *data;
28
+ size_t size;
29
+
30
+ /* Remaining data */
31
+ const char *ptr;
32
+ size_t remaining;
33
+
34
+ /* Buffer for unescaped strings */
35
+ char *outBuf;
36
+ char *outPtr; /* Free space at end of buffer */
37
+
38
+ xmlHashTablePtr entities; /* Maps URLs to xmlFuzzEntityInfos */
39
+
40
+ /* The first entity is the main entity. */
41
+ const char *mainUrl;
42
+ xmlFuzzEntityInfo *mainEntity;
43
+ } fuzzData;
44
+
45
+ size_t fuzzNumAttempts;
46
+ size_t fuzzFailurePos;
47
+ int fuzzAllocFailed;
48
+ int fuzzIoFailed;
49
+
50
+ /**
51
+ * xmlFuzzErrorFunc:
52
+ *
53
+ * An error function that simply discards all errors.
54
+ */
55
+ void
56
+ xmlFuzzErrorFunc(void *ctx ATTRIBUTE_UNUSED, const char *msg ATTRIBUTE_UNUSED,
57
+ ...) {
58
+ }
59
+
60
+ /**
61
+ * xmlFuzzSErrorFunc:
62
+ *
63
+ * A structured error function that simply discards all errors.
64
+ */
65
+ void
66
+ xmlFuzzSErrorFunc(void *ctx ATTRIBUTE_UNUSED,
67
+ const xmlError *error ATTRIBUTE_UNUSED) {
68
+ }
69
+
70
+ /*
71
+ * Failure injection.
72
+ *
73
+ * To debug issues involving injected failures, it's often helpful to set
74
+ * FAILURE_ABORT to 1. This should provide a backtrace of the failed
75
+ * operation.
76
+ */
77
+
78
+ #define XML_FUZZ_FAILURE_ABORT 0
79
+
80
+ void
81
+ xmlFuzzInjectFailure(size_t failurePos) {
82
+ fuzzNumAttempts = 0;
83
+ fuzzFailurePos = failurePos;
84
+ fuzzAllocFailed = 0;
85
+ fuzzIoFailed = 0;
86
+ }
87
+
88
+ static int
89
+ xmlFuzzTryMalloc(void) {
90
+ if (fuzzFailurePos > 0) {
91
+ fuzzNumAttempts += 1;
92
+ if (fuzzNumAttempts == fuzzFailurePos) {
93
+ #if XML_FUZZ_FAILURE_ABORT
94
+ abort();
95
+ #endif
96
+ fuzzAllocFailed = 1;
97
+ return -1;
98
+ }
99
+ }
100
+
101
+ return 0;
102
+ }
103
+
104
+ static int
105
+ xmlFuzzTryIo(void) {
106
+ if (fuzzFailurePos > 0) {
107
+ fuzzNumAttempts += 1;
108
+ if (fuzzNumAttempts == fuzzFailurePos) {
109
+ #if XML_FUZZ_FAILURE_ABORT
110
+ abort();
111
+ #endif
112
+ fuzzIoFailed = 1;
113
+ return -1;
114
+ }
115
+ }
116
+
117
+ return 0;
118
+ }
119
+
120
+ static void *
121
+ xmlFuzzMalloc(size_t size) {
122
+ void *ret;
123
+
124
+ if (xmlFuzzTryMalloc() < 0)
125
+ return NULL;
126
+
127
+ ret = malloc(size);
128
+ if (ret == NULL)
129
+ fuzzAllocFailed = 1;
130
+
131
+ return ret;
132
+ }
133
+
134
+ static void *
135
+ xmlFuzzRealloc(void *ptr, size_t size) {
136
+ void *ret;
137
+
138
+ if (xmlFuzzTryMalloc() < 0)
139
+ return NULL;
140
+
141
+ ret = realloc(ptr, size);
142
+ if (ret == NULL)
143
+ fuzzAllocFailed = 1;
144
+
145
+ return ret;
146
+ }
147
+
148
+ void
149
+ xmlFuzzMemSetup(void) {
150
+ xmlMemSetup(free, xmlFuzzMalloc, xmlFuzzRealloc, xmlMemStrdup);
151
+ }
152
+
153
+ int
154
+ xmlFuzzMallocFailed(void) {
155
+ return fuzzAllocFailed;
156
+ }
157
+
158
+ void
159
+ xmlFuzzResetFailure(void) {
160
+ fuzzAllocFailed = 0;
161
+ fuzzIoFailed = 0;
162
+ }
163
+
164
+ void
165
+ xmlFuzzCheckFailureReport(const char *func, int oomReport, int ioReport) {
166
+ if (oomReport >= 0 && fuzzAllocFailed != oomReport) {
167
+ fprintf(stderr, "%s: malloc failure %s reported\n",
168
+ func, fuzzAllocFailed ? "not" : "erroneously");
169
+ abort();
170
+ }
171
+ if (ioReport >= 0 && fuzzIoFailed != ioReport) {
172
+ fprintf(stderr, "%s: IO failure %s reported\n",
173
+ func, fuzzIoFailed ? "not" : "erroneously");
174
+ abort();
175
+ }
176
+ fuzzAllocFailed = 0;
177
+ fuzzIoFailed = 0;
178
+ }
179
+
180
+ /**
181
+ * xmlFuzzDataInit:
182
+ *
183
+ * Initialize fuzz data provider.
184
+ */
185
+ void
186
+ xmlFuzzDataInit(const char *data, size_t size) {
187
+ fuzzData.data = data;
188
+ fuzzData.size = size;
189
+ fuzzData.ptr = data;
190
+ fuzzData.remaining = size;
191
+
192
+ fuzzData.outBuf = xmlMalloc(size + 1);
193
+ fuzzData.outPtr = fuzzData.outBuf;
194
+
195
+ fuzzData.entities = xmlHashCreate(8);
196
+ fuzzData.mainUrl = NULL;
197
+ fuzzData.mainEntity = NULL;
198
+ }
199
+
200
+ /**
201
+ * xmlFuzzDataFree:
202
+ *
203
+ * Cleanup fuzz data provider.
204
+ */
205
+ void
206
+ xmlFuzzDataCleanup(void) {
207
+ xmlFree(fuzzData.outBuf);
208
+ xmlHashFree(fuzzData.entities, xmlHashDefaultDeallocator);
209
+ }
210
+
211
+ /**
212
+ * xmlFuzzWriteInt:
213
+ * @out: output file
214
+ * @v: integer to write
215
+ * @size: size of integer in bytes
216
+ *
217
+ * Write an integer to the fuzz data.
218
+ */
219
+ void
220
+ xmlFuzzWriteInt(FILE *out, size_t v, int size) {
221
+ int shift;
222
+
223
+ while (size > (int) sizeof(size_t)) {
224
+ putc(0, out);
225
+ size--;
226
+ }
227
+
228
+ shift = size * 8;
229
+ while (shift > 0) {
230
+ shift -= 8;
231
+ putc((v >> shift) & 255, out);
232
+ }
233
+ }
234
+
235
+ /**
236
+ * xmlFuzzReadInt:
237
+ * @size: size of integer in bytes
238
+ *
239
+ * Read an integer from the fuzz data.
240
+ */
241
+ size_t
242
+ xmlFuzzReadInt(int size) {
243
+ size_t ret = 0;
244
+
245
+ while ((size > 0) && (fuzzData.remaining > 0)) {
246
+ unsigned char c = (unsigned char) *fuzzData.ptr++;
247
+ fuzzData.remaining--;
248
+ ret = (ret << 8) | c;
249
+ size--;
250
+ }
251
+
252
+ return ret;
253
+ }
254
+
255
+ /**
256
+ * xmlFuzzBytesRemaining:
257
+ *
258
+ * Return number of remaining bytes in fuzz data.
259
+ */
260
+ size_t
261
+ xmlFuzzBytesRemaining(void) {
262
+ return(fuzzData.remaining);
263
+ }
264
+
265
+ /**
266
+ * xmlFuzzReadRemaining:
267
+ * @size: size of string in bytes
268
+ *
269
+ * Read remaining bytes from fuzz data.
270
+ */
271
+ const char *
272
+ xmlFuzzReadRemaining(size_t *size) {
273
+ const char *ret = fuzzData.ptr;
274
+
275
+ *size = fuzzData.remaining;
276
+ fuzzData.ptr += fuzzData.remaining;
277
+ fuzzData.remaining = 0;
278
+
279
+ return(ret);
280
+ }
281
+
282
+ /*
283
+ * xmlFuzzWriteString:
284
+ * @out: output file
285
+ * @str: string to write
286
+ *
287
+ * Write a random-length string to file in a format similar to
288
+ * FuzzedDataProvider. Backslash followed by newline marks the end of the
289
+ * string. Two backslashes are used to escape a backslash.
290
+ */
291
+ void
292
+ xmlFuzzWriteString(FILE *out, const char *str) {
293
+ for (; *str; str++) {
294
+ int c = (unsigned char) *str;
295
+ putc(c, out);
296
+ if (c == '\\')
297
+ putc(c, out);
298
+ }
299
+ putc('\\', out);
300
+ putc('\n', out);
301
+ }
302
+
303
+ /**
304
+ * xmlFuzzReadString:
305
+ * @size: size of string in bytes
306
+ *
307
+ * Read a random-length string from the fuzz data.
308
+ *
309
+ * The format is similar to libFuzzer's FuzzedDataProvider but treats
310
+ * backslash followed by newline as end of string. This makes the fuzz data
311
+ * more readable. A backslash character is escaped with another backslash.
312
+ *
313
+ * Returns a zero-terminated string or NULL if the fuzz data is exhausted.
314
+ */
315
+ const char *
316
+ xmlFuzzReadString(size_t *size) {
317
+ const char *out = fuzzData.outPtr;
318
+
319
+ while (fuzzData.remaining > 0) {
320
+ int c = *fuzzData.ptr++;
321
+ fuzzData.remaining--;
322
+
323
+ if ((c == '\\') && (fuzzData.remaining > 0)) {
324
+ int c2 = *fuzzData.ptr;
325
+
326
+ if (c2 == '\n') {
327
+ fuzzData.ptr++;
328
+ fuzzData.remaining--;
329
+ if (size != NULL)
330
+ *size = fuzzData.outPtr - out;
331
+ *fuzzData.outPtr++ = '\0';
332
+ return(out);
333
+ }
334
+ if (c2 == '\\') {
335
+ fuzzData.ptr++;
336
+ fuzzData.remaining--;
337
+ }
338
+ }
339
+
340
+ *fuzzData.outPtr++ = c;
341
+ }
342
+
343
+ if (fuzzData.outPtr > out) {
344
+ if (size != NULL)
345
+ *size = fuzzData.outPtr - out;
346
+ *fuzzData.outPtr++ = '\0';
347
+ return(out);
348
+ }
349
+
350
+ if (size != NULL)
351
+ *size = 0;
352
+ return(NULL);
353
+ }
354
+
355
+ /**
356
+ * xmlFuzzReadEntities:
357
+ *
358
+ * Read entities like the main XML file, external DTDs, external parsed
359
+ * entities from fuzz data.
360
+ */
361
+ void
362
+ xmlFuzzReadEntities(void) {
363
+ size_t num = 0;
364
+
365
+ while (1) {
366
+ const char *url, *entity;
367
+ size_t urlSize, entitySize;
368
+ xmlFuzzEntityInfo *entityInfo;
369
+
370
+ url = xmlFuzzReadString(&urlSize);
371
+ if (url == NULL) break;
372
+
373
+ entity = xmlFuzzReadString(&entitySize);
374
+ if (entity == NULL) break;
375
+
376
+ /*
377
+ * Cap URL size to avoid quadratic behavior when generating
378
+ * error messages or looking up entities.
379
+ */
380
+ if (urlSize < 50 &&
381
+ xmlHashLookup(fuzzData.entities, (xmlChar *)url) == NULL) {
382
+ entityInfo = xmlMalloc(sizeof(xmlFuzzEntityInfo));
383
+ if (entityInfo == NULL)
384
+ break;
385
+ entityInfo->data = entity;
386
+ entityInfo->size = entitySize;
387
+
388
+ xmlHashAddEntry(fuzzData.entities, (xmlChar *)url, entityInfo);
389
+
390
+ if (num == 0) {
391
+ fuzzData.mainUrl = url;
392
+ fuzzData.mainEntity = entityInfo;
393
+ }
394
+
395
+ num++;
396
+ }
397
+ }
398
+ }
399
+
400
+ /**
401
+ * xmlFuzzMainUrl:
402
+ *
403
+ * Returns the main URL.
404
+ */
405
+ const char *
406
+ xmlFuzzMainUrl(void) {
407
+ return(fuzzData.mainUrl);
408
+ }
409
+
410
+ /**
411
+ * xmlFuzzMainEntity:
412
+ * @size: size of the main entity in bytes
413
+ *
414
+ * Returns the main entity.
415
+ */
416
+ const char *
417
+ xmlFuzzMainEntity(size_t *size) {
418
+ if (fuzzData.mainEntity == NULL)
419
+ return(NULL);
420
+ *size = fuzzData.mainEntity->size;
421
+ return(fuzzData.mainEntity->data);
422
+ }
423
+
424
+ /**
425
+ * xmlFuzzResourceLoader:
426
+ *
427
+ * The resource loader for fuzz data.
428
+ */
429
+ int
430
+ xmlFuzzResourceLoader(void *data ATTRIBUTE_UNUSED, const char *URL,
431
+ const char *ID ATTRIBUTE_UNUSED,
432
+ xmlResourceType type ATTRIBUTE_UNUSED,
433
+ int flags ATTRIBUTE_UNUSED, xmlParserInputPtr *out) {
434
+ xmlParserInputPtr input;
435
+ xmlFuzzEntityInfo *entity;
436
+
437
+ entity = xmlHashLookup(fuzzData.entities, (xmlChar *) URL);
438
+ if (entity == NULL)
439
+ return(XML_IO_ENOENT);
440
+
441
+ /* IO failure injection */
442
+ if (xmlFuzzTryIo() < 0)
443
+ return(XML_IO_EIO);
444
+
445
+ input = xmlNewInputFromMemory(URL, entity->data, entity->size,
446
+ XML_INPUT_BUF_STATIC |
447
+ XML_INPUT_BUF_ZERO_TERMINATED);
448
+ if (input == NULL)
449
+ return(XML_ERR_NO_MEMORY);
450
+
451
+ *out = input;
452
+ return(XML_ERR_OK);
453
+ }
454
+
455
+ char *
456
+ xmlSlurpFile(const char *path, size_t *sizeRet) {
457
+ FILE *file;
458
+ struct stat statbuf;
459
+ char *data;
460
+ size_t size;
461
+
462
+ if ((stat(path, &statbuf) != 0) || (!S_ISREG(statbuf.st_mode)))
463
+ return(NULL);
464
+ size = statbuf.st_size;
465
+ file = fopen(path, "rb");
466
+ if (file == NULL)
467
+ return(NULL);
468
+ data = xmlMalloc(size + 1);
469
+ if (data != NULL) {
470
+ if (fread(data, 1, size, file) != size) {
471
+ xmlFree(data);
472
+ data = NULL;
473
+ } else {
474
+ data[size] = 0;
475
+ if (sizeRet != NULL)
476
+ *sizeRet = size;
477
+ }
478
+ }
479
+ fclose(file);
480
+
481
+ return(data);
482
+ }
483
+
484
+ int
485
+ xmlFuzzOutputWrite(void *ctxt ATTRIBUTE_UNUSED,
486
+ const char *buffer ATTRIBUTE_UNUSED, int len) {
487
+ if (xmlFuzzTryIo() < 0)
488
+ return -XML_IO_EIO;
489
+
490
+ return len;
491
+ }
492
+
493
+ int
494
+ xmlFuzzOutputClose(void *ctxt ATTRIBUTE_UNUSED) {
495
+ if (xmlFuzzTryIo() < 0)
496
+ return XML_IO_EIO;
497
+
498
+ return 0;
499
+ }
500
+
local-test-libxml2-full-01/afc-libxml2/fuzz/fuzz.h ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * fuzz.h: Common functions and macros for fuzzing.
3
+ *
4
+ * See Copyright for the status of this software.
5
+ */
6
+
7
+ #ifndef __XML_FUZZERCOMMON_H__
8
+ #define __XML_FUZZERCOMMON_H__
9
+
10
+ #include <stddef.h>
11
+ #include <stdio.h>
12
+ #include <libxml/parser.h>
13
+
14
+ #ifdef __cplusplus
15
+ extern "C" {
16
+ #endif
17
+
18
+ #if __GNUC__ * 100 + __GNUC_MINOR__ >= 207 || defined(__clang__)
19
+ #define ATTRIBUTE_UNUSED __attribute__((unused))
20
+ #else
21
+ #define ATTRIBUTE_UNUSED
22
+ #endif
23
+
24
+ #if defined(LIBXML_HTML_ENABLED)
25
+ #define HAVE_HTML_FUZZER
26
+ #endif
27
+ #if 1
28
+ #define HAVE_LINT_FUZZER
29
+ #endif
30
+ #if defined(LIBXML_READER_ENABLED)
31
+ #define HAVE_READER_FUZZER
32
+ #endif
33
+ #if defined(LIBXML_REGEXP_ENABLED)
34
+ #define HAVE_REGEXP_FUZZER
35
+ #endif
36
+ #if defined(LIBXML_SCHEMAS_ENABLED)
37
+ #define HAVE_SCHEMA_FUZZER
38
+ #endif
39
+ #if 1
40
+ #define HAVE_URI_FUZZER
41
+ #endif
42
+ #if defined(LIBXML_VALID_ENABLED)
43
+ #define HAVE_VALID_FUZZER
44
+ #endif
45
+ #if defined(LIBXML_XINCLUDE_ENABLED)
46
+ #define HAVE_XINCLUDE_FUZZER
47
+ #endif
48
+ #if 1
49
+ #define HAVE_XML_FUZZER
50
+ #endif
51
+ #if defined(LIBXML_XPTR_ENABLED)
52
+ #define HAVE_XPATH_FUZZER
53
+ #endif
54
+
55
+ int
56
+ LLVMFuzzerInitialize(int *argc, char ***argv);
57
+
58
+ int
59
+ LLVMFuzzerTestOneInput(const char *data, size_t size);
60
+
61
+ void
62
+ xmlFuzzErrorFunc(void *ctx, const char *msg, ...);
63
+
64
+ void
65
+ xmlFuzzSErrorFunc(void *ctx, const xmlError *error);
66
+
67
+ void
68
+ xmlFuzzMemSetup(void);
69
+
70
+ void
71
+ xmlFuzzInjectFailure(size_t failurePos);
72
+
73
+ int
74
+ xmlFuzzMallocFailed(void);
75
+
76
+ void
77
+ xmlFuzzResetFailure(void);
78
+
79
+ void
80
+ xmlFuzzCheckFailureReport(const char *func, int oomReport, int ioReport);
81
+
82
+ void
83
+ xmlFuzzDataInit(const char *data, size_t size);
84
+
85
+ void
86
+ xmlFuzzDataCleanup(void);
87
+
88
+ void
89
+ xmlFuzzWriteInt(FILE *out, size_t v, int size);
90
+
91
+ size_t
92
+ xmlFuzzReadInt(int size);
93
+
94
+ size_t
95
+ xmlFuzzBytesRemaining(void);
96
+
97
+ const char *
98
+ xmlFuzzReadRemaining(size_t *size);
99
+
100
+ void
101
+ xmlFuzzWriteString(FILE *out, const char *str);
102
+
103
+ const char *
104
+ xmlFuzzReadString(size_t *size);
105
+
106
+ void
107
+ xmlFuzzReadEntities(void);
108
+
109
+ const char *
110
+ xmlFuzzMainUrl(void);
111
+
112
+ const char *
113
+ xmlFuzzMainEntity(size_t *size);
114
+
115
+ int
116
+ xmlFuzzResourceLoader(void *data, const char *URL, const char *ID,
117
+ xmlResourceType type, int flags, xmlParserInputPtr *out);
118
+
119
+ char *
120
+ xmlSlurpFile(const char *path, size_t *size);
121
+
122
+ int
123
+ xmlFuzzOutputWrite(void *ctxt, const char *buffer, int len);
124
+
125
+ int
126
+ xmlFuzzOutputClose(void *ctxt);
127
+
128
+ #ifdef __cplusplus
129
+ }
130
+ #endif
131
+
132
+ #endif /* __XML_FUZZERCOMMON_H__ */
133
+
local-test-libxml2-full-01/afc-libxml2/fuzz/genSeed.c ADDED
@@ -0,0 +1,514 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * xmlSeed.c: Generate the XML seed corpus for fuzzing.
3
+ *
4
+ * See Copyright for the status of this software.
5
+ */
6
+
7
+ #include <stdio.h>
8
+ #include <string.h>
9
+ #include <glob.h>
10
+ #include <libgen.h>
11
+ #include <sys/stat.h>
12
+
13
+ #ifdef _WIN32
14
+ #include <direct.h>
15
+ #else
16
+ #include <unistd.h>
17
+ #endif
18
+
19
+ #include <libxml/parser.h>
20
+ #include <libxml/parserInternals.h>
21
+ #include <libxml/HTMLparser.h>
22
+ #include <libxml/xinclude.h>
23
+ #include <libxml/xmlschemas.h>
24
+ #include "fuzz.h"
25
+
26
+ #define PATH_SIZE 500
27
+ #define SEED_BUF_SIZE 16384
28
+ #define EXPR_SIZE 4500
29
+
30
+ #define FLAG_READER (1 << 0)
31
+ #define FLAG_LINT (1 << 1)
32
+
33
+ typedef int
34
+ (*fileFunc)(const char *base, FILE *out);
35
+
36
+ typedef int
37
+ (*mainFunc)(const char *arg);
38
+
39
+ static struct {
40
+ FILE *out;
41
+ xmlHashTablePtr entities; /* Maps URLs to xmlFuzzEntityInfos */
42
+ xmlExternalEntityLoader oldLoader;
43
+ fileFunc processFile;
44
+ const char *fuzzer;
45
+ int counter;
46
+ char cwd[PATH_SIZE];
47
+ int flags;
48
+ } globalData;
49
+
50
+ #if defined(HAVE_SCHEMA_FUZZER) || \
51
+ defined(HAVE_XML_FUZZER)
52
+ /*
53
+ * A custom resource loader that writes all external DTDs or entities to a
54
+ * single file in the format expected by xmlFuzzResourceLoader.
55
+ */
56
+ static int
57
+ fuzzResourceRecorder(void *data ATTRIBUTE_UNUSED, const char *URL,
58
+ const char *ID ATTRIBUTE_UNUSED,
59
+ xmlResourceType type ATTRIBUTE_UNUSED, int flags,
60
+ xmlParserInputPtr *out) {
61
+ xmlParserInputPtr in;
62
+ static const int chunkSize = 16384;
63
+ int code, len;
64
+
65
+ *out = NULL;
66
+
67
+ code = xmlNewInputFromUrl(URL, flags, &in);
68
+ if (code != XML_ERR_OK)
69
+ return(code);
70
+
71
+ if (globalData.entities == NULL) {
72
+ globalData.entities = xmlHashCreate(4);
73
+ } else if (xmlHashLookup(globalData.entities,
74
+ (const xmlChar *) URL) != NULL) {
75
+ *out = in;
76
+ return(XML_ERR_OK);
77
+ }
78
+
79
+ do {
80
+ len = xmlParserInputGrow(in, chunkSize);
81
+ if (len < 0) {
82
+ fprintf(stderr, "Error reading %s\n", URL);
83
+ xmlFreeInputStream(in);
84
+ return(in->buf->error);
85
+ }
86
+ } while (len > 0);
87
+
88
+ xmlFuzzWriteString(globalData.out, URL);
89
+ xmlFuzzWriteString(globalData.out,
90
+ (char *) xmlBufContent(in->buf->buffer));
91
+
92
+ xmlFreeInputStream(in);
93
+
94
+ xmlHashAddEntry(globalData.entities, (const xmlChar *) URL,
95
+ globalData.entities);
96
+
97
+ return(xmlNewInputFromUrl(URL, flags, out));
98
+ }
99
+
100
+ static void
101
+ fuzzRecorderInit(FILE *out) {
102
+ globalData.out = out;
103
+ globalData.entities = xmlHashCreate(8);
104
+ globalData.oldLoader = xmlGetExternalEntityLoader();
105
+ }
106
+
107
+ static void
108
+ fuzzRecorderCleanup(void) {
109
+ xmlHashFree(globalData.entities, NULL);
110
+ globalData.out = NULL;
111
+ globalData.entities = NULL;
112
+ globalData.oldLoader = NULL;
113
+ }
114
+ #endif
115
+
116
+ #ifdef HAVE_XML_FUZZER
117
+ static int
118
+ processXml(const char *docFile, FILE *out) {
119
+ int opts = XML_PARSE_NOENT | XML_PARSE_DTDLOAD;
120
+ xmlParserCtxtPtr ctxt;
121
+ xmlDocPtr doc;
122
+
123
+ if (globalData.flags & FLAG_LINT) {
124
+ /* Switches */
125
+ xmlFuzzWriteInt(out, 0, 4);
126
+ xmlFuzzWriteInt(out, 0, 4);
127
+ /* maxmem */
128
+ xmlFuzzWriteInt(out, 0, 4);
129
+ /* max-ampl */
130
+ xmlFuzzWriteInt(out, 0, 1);
131
+ /* pretty */
132
+ xmlFuzzWriteInt(out, 0, 1);
133
+ /* encode */
134
+ xmlFuzzWriteString(out, "");
135
+ /* pattern */
136
+ xmlFuzzWriteString(out, "");
137
+ /* xpath */
138
+ xmlFuzzWriteString(out, "");
139
+ } else {
140
+ /* Parser options. */
141
+ xmlFuzzWriteInt(out, opts, 4);
142
+ /* Max allocations. */
143
+ xmlFuzzWriteInt(out, 0, 4);
144
+
145
+ if (globalData.flags & FLAG_READER) {
146
+ /* Initial reader program with a couple of OP_READs */
147
+ xmlFuzzWriteString(out, "\x01\x01\x01\x01\x01\x01\x01\x01");
148
+ }
149
+ }
150
+
151
+ fuzzRecorderInit(out);
152
+
153
+ ctxt = xmlNewParserCtxt();
154
+ xmlCtxtSetErrorHandler(ctxt, xmlFuzzSErrorFunc, NULL);
155
+ xmlCtxtSetResourceLoader(ctxt, fuzzResourceRecorder, NULL);
156
+ doc = xmlCtxtReadFile(ctxt, docFile, NULL, opts);
157
+ #ifdef LIBXML_XINCLUDE_ENABLED
158
+ {
159
+ xmlXIncludeCtxtPtr xinc = xmlXIncludeNewContext(doc);
160
+
161
+ xmlXIncludeSetErrorHandler(xinc, xmlFuzzSErrorFunc, NULL);
162
+ xmlXIncludeSetResourceLoader(xinc, fuzzResourceRecorder, NULL);
163
+ xmlXIncludeSetFlags(xinc, opts);
164
+ xmlXIncludeProcessNode(xinc, (xmlNodePtr) doc);
165
+ xmlXIncludeFreeContext(xinc);
166
+ }
167
+ #endif
168
+ xmlFreeDoc(doc);
169
+ xmlFreeParserCtxt(ctxt);
170
+
171
+ fuzzRecorderCleanup();
172
+
173
+ return(0);
174
+ }
175
+ #endif
176
+
177
+ #ifdef HAVE_HTML_FUZZER
178
+ static int
179
+ processHtml(const char *docFile, FILE *out) {
180
+ char buf[SEED_BUF_SIZE];
181
+ FILE *file;
182
+ size_t size;
183
+
184
+ /* Parser options. */
185
+ xmlFuzzWriteInt(out, 0, 4);
186
+ /* Max allocations. */
187
+ xmlFuzzWriteInt(out, 0, 4);
188
+
189
+ /* Copy file */
190
+ file = fopen(docFile, "rb");
191
+ if (file == NULL) {
192
+ fprintf(stderr, "couldn't open %s\n", docFile);
193
+ return(0);
194
+ }
195
+ do {
196
+ size = fread(buf, 1, SEED_BUF_SIZE, file);
197
+ if (size > 0)
198
+ fwrite(buf, 1, size, out);
199
+ } while (size == SEED_BUF_SIZE);
200
+ fclose(file);
201
+
202
+ return(0);
203
+ }
204
+ #endif
205
+
206
+ #ifdef HAVE_SCHEMA_FUZZER
207
+ static int
208
+ processSchema(const char *docFile, FILE *out) {
209
+ xmlSchemaPtr schema;
210
+ xmlSchemaParserCtxtPtr pctxt;
211
+
212
+ /* Max allocations. */
213
+ xmlFuzzWriteInt(out, 0, 4);
214
+
215
+ fuzzRecorderInit(out);
216
+
217
+ pctxt = xmlSchemaNewParserCtxt(docFile);
218
+ xmlSchemaSetParserStructuredErrors(pctxt, xmlFuzzSErrorFunc, NULL);
219
+ xmlSchemaSetResourceLoader(pctxt, fuzzResourceRecorder, NULL);
220
+ schema = xmlSchemaParse(pctxt);
221
+ xmlSchemaFreeParserCtxt(pctxt);
222
+ xmlSchemaFree(schema);
223
+
224
+ fuzzRecorderCleanup();
225
+
226
+ return(0);
227
+ }
228
+ #endif
229
+
230
+ #if defined(HAVE_HTML_FUZZER) || \
231
+ defined(HAVE_SCHEMA_FUZZER) || \
232
+ defined(HAVE_XML_FUZZER)
233
+ static int
234
+ processPattern(const char *pattern) {
235
+ glob_t globbuf;
236
+ int ret = 0;
237
+ int res;
238
+ size_t i;
239
+
240
+ res = glob(pattern, 0, NULL, &globbuf);
241
+ if (res == GLOB_NOMATCH)
242
+ return(0);
243
+ if (res != 0) {
244
+ fprintf(stderr, "couldn't match pattern %s\n", pattern);
245
+ return(-1);
246
+ }
247
+
248
+ for (i = 0; i < globbuf.gl_pathc; i++) {
249
+ struct stat statbuf;
250
+ char outPath[PATH_SIZE];
251
+ char *dirBuf = NULL;
252
+ char *baseBuf = NULL;
253
+ const char *path, *dir, *base;
254
+ FILE *out = NULL;
255
+ int dirChanged = 0;
256
+ size_t size;
257
+
258
+ path = globbuf.gl_pathv[i];
259
+
260
+ if ((stat(path, &statbuf) != 0) || (!S_ISREG(statbuf.st_mode)))
261
+ continue;
262
+
263
+ dirBuf = (char *) xmlCharStrdup(path);
264
+ baseBuf = (char *) xmlCharStrdup(path);
265
+ if ((dirBuf == NULL) || (baseBuf == NULL)) {
266
+ fprintf(stderr, "memory allocation failed\n");
267
+ ret = -1;
268
+ goto error;
269
+ }
270
+ dir = dirname(dirBuf);
271
+ base = basename(baseBuf);
272
+
273
+ size = snprintf(outPath, sizeof(outPath), "seed/%s/%s",
274
+ globalData.fuzzer, base);
275
+ if (size >= PATH_SIZE) {
276
+ fprintf(stderr, "creating path failed\n");
277
+ ret = -1;
278
+ goto error;
279
+ }
280
+ out = fopen(outPath, "wb");
281
+ if (out == NULL) {
282
+ fprintf(stderr, "couldn't open %s for writing\n", outPath);
283
+ ret = -1;
284
+ goto error;
285
+ }
286
+ if (chdir(dir) != 0) {
287
+ fprintf(stderr, "couldn't chdir to %s\n", dir);
288
+ ret = -1;
289
+ goto error;
290
+ }
291
+ dirChanged = 1;
292
+ if (globalData.processFile(base, out) != 0)
293
+ ret = -1;
294
+
295
+ error:
296
+ if (out != NULL)
297
+ fclose(out);
298
+ xmlFree(dirBuf);
299
+ xmlFree(baseBuf);
300
+ if ((dirChanged) && (chdir(globalData.cwd) != 0)) {
301
+ fprintf(stderr, "couldn't chdir to %s\n", globalData.cwd);
302
+ ret = -1;
303
+ break;
304
+ }
305
+ }
306
+
307
+ globfree(&globbuf);
308
+ return(ret);
309
+ }
310
+ #endif
311
+
312
+ #ifdef HAVE_XPATH_FUZZER
313
+ static int
314
+ processXPath(const char *testDir, const char *prefix, const char *name,
315
+ const char *data, const char *subdir, int xptr) {
316
+ char pattern[PATH_SIZE];
317
+ glob_t globbuf;
318
+ size_t i, size;
319
+ int ret = 0, res;
320
+
321
+ size = snprintf(pattern, sizeof(pattern), "%s/%s/%s*",
322
+ testDir, subdir, prefix);
323
+ if (size >= PATH_SIZE)
324
+ return(-1);
325
+ res = glob(pattern, 0, NULL, &globbuf);
326
+ if (res == GLOB_NOMATCH)
327
+ return(0);
328
+ if (res != 0) {
329
+ fprintf(stderr, "couldn't match pattern %s\n", pattern);
330
+ return(-1);
331
+ }
332
+
333
+ for (i = 0; i < globbuf.gl_pathc; i++) {
334
+ char *path = globbuf.gl_pathv[i];
335
+ struct stat statbuf;
336
+ FILE *in;
337
+ char expr[EXPR_SIZE];
338
+
339
+ if ((stat(path, &statbuf) != 0) || (!S_ISREG(statbuf.st_mode)))
340
+ continue;
341
+
342
+ in = fopen(path, "rb");
343
+ if (in == NULL) {
344
+ ret = -1;
345
+ continue;
346
+ }
347
+
348
+ while (fgets(expr, EXPR_SIZE, in) != NULL) {
349
+ char outPath[PATH_SIZE];
350
+ FILE *out;
351
+ int j;
352
+
353
+ for (j = 0; expr[j] != 0; j++)
354
+ if (expr[j] == '\r' || expr[j] == '\n')
355
+ break;
356
+ expr[j] = 0;
357
+
358
+ size = snprintf(outPath, sizeof(outPath), "seed/xpath/%s-%d",
359
+ name, globalData.counter);
360
+ if (size >= PATH_SIZE) {
361
+ ret = -1;
362
+ continue;
363
+ }
364
+ out = fopen(outPath, "wb");
365
+ if (out == NULL) {
366
+ ret = -1;
367
+ continue;
368
+ }
369
+
370
+ /* Max allocations. */
371
+ xmlFuzzWriteInt(out, 0, 4);
372
+
373
+ if (xptr) {
374
+ xmlFuzzWriteString(out, expr);
375
+ } else {
376
+ char xptrExpr[EXPR_SIZE+100];
377
+
378
+ /* Wrap XPath expressions as XPointer */
379
+ snprintf(xptrExpr, sizeof(xptrExpr), "xpointer(%s)", expr);
380
+ xmlFuzzWriteString(out, xptrExpr);
381
+ }
382
+
383
+ xmlFuzzWriteString(out, data);
384
+
385
+ fclose(out);
386
+ globalData.counter++;
387
+ }
388
+
389
+ fclose(in);
390
+ }
391
+
392
+ globfree(&globbuf);
393
+
394
+ return(ret);
395
+ }
396
+
397
+ static int
398
+ processXPathDir(const char *testDir) {
399
+ char pattern[PATH_SIZE];
400
+ glob_t globbuf;
401
+ size_t i, size;
402
+ int ret = 0;
403
+
404
+ globalData.counter = 1;
405
+ if (processXPath(testDir, "", "expr", "<d></d>", "expr", 0) != 0)
406
+ ret = -1;
407
+
408
+ size = snprintf(pattern, sizeof(pattern), "%s/docs/*", testDir);
409
+ if (size >= PATH_SIZE)
410
+ return(1);
411
+ if (glob(pattern, 0, NULL, &globbuf) != 0)
412
+ return(1);
413
+
414
+ for (i = 0; i < globbuf.gl_pathc; i++) {
415
+ char *path = globbuf.gl_pathv[i];
416
+ char *data;
417
+ const char *docFile;
418
+
419
+ data = xmlSlurpFile(path, NULL);
420
+ if (data == NULL) {
421
+ ret = -1;
422
+ continue;
423
+ }
424
+ docFile = basename(path);
425
+
426
+ globalData.counter = 1;
427
+ if (processXPath(testDir, docFile, docFile, data, "tests", 0) != 0)
428
+ ret = -1;
429
+ if (processXPath(testDir, docFile, docFile, data, "xptr", 1) != 0)
430
+ ret = -1;
431
+ if (processXPath(testDir, docFile, docFile, data, "xptr-xp1", 1) != 0)
432
+ ret = -1;
433
+
434
+ xmlFree(data);
435
+ }
436
+
437
+ globfree(&globbuf);
438
+
439
+ return(ret);
440
+ }
441
+ #endif
442
+
443
+ int
444
+ main(int argc, const char **argv) {
445
+ mainFunc processArg = NULL;
446
+ const char *fuzzer;
447
+ int ret = 0;
448
+ int i;
449
+
450
+ if (argc < 3) {
451
+ fprintf(stderr, "usage: seed [FUZZER] [PATTERN...]\n");
452
+ return(1);
453
+ }
454
+
455
+ fuzzer = argv[1];
456
+ if (strcmp(fuzzer, "html") == 0) {
457
+ #ifdef HAVE_HTML_FUZZER
458
+ processArg = processPattern;
459
+ globalData.processFile = processHtml;
460
+ #endif
461
+ } else if (strcmp(fuzzer, "lint") == 0) {
462
+ #ifdef HAVE_LINT_FUZZER
463
+ processArg = processPattern;
464
+ globalData.flags |= FLAG_LINT;
465
+ globalData.processFile = processXml;
466
+ #endif
467
+ } else if (strcmp(fuzzer, "reader") == 0) {
468
+ #ifdef HAVE_READER_FUZZER
469
+ processArg = processPattern;
470
+ globalData.flags |= FLAG_READER;
471
+ globalData.processFile = processXml;
472
+ #endif
473
+ } else if (strcmp(fuzzer, "schema") == 0) {
474
+ #ifdef HAVE_SCHEMA_FUZZER
475
+ processArg = processPattern;
476
+ globalData.processFile = processSchema;
477
+ #endif
478
+ } else if (strcmp(fuzzer, "valid") == 0) {
479
+ #ifdef HAVE_VALID_FUZZER
480
+ processArg = processPattern;
481
+ globalData.processFile = processXml;
482
+ #endif
483
+ } else if (strcmp(fuzzer, "xinclude") == 0) {
484
+ #ifdef HAVE_XINCLUDE_FUZZER
485
+ processArg = processPattern;
486
+ globalData.processFile = processXml;
487
+ #endif
488
+ } else if (strcmp(fuzzer, "xml") == 0) {
489
+ #ifdef HAVE_XML_FUZZER
490
+ processArg = processPattern;
491
+ globalData.processFile = processXml;
492
+ #endif
493
+ } else if (strcmp(fuzzer, "xpath") == 0) {
494
+ #ifdef HAVE_XPATH_FUZZER
495
+ processArg = processXPathDir;
496
+ #endif
497
+ } else {
498
+ fprintf(stderr, "unknown fuzzer %s\n", fuzzer);
499
+ return(1);
500
+ }
501
+ globalData.fuzzer = fuzzer;
502
+
503
+ if (getcwd(globalData.cwd, PATH_SIZE) == NULL) {
504
+ fprintf(stderr, "couldn't get current directory\n");
505
+ return(1);
506
+ }
507
+
508
+ if (processArg != NULL)
509
+ for (i = 2; i < argc; i++)
510
+ processArg(argv[i]);
511
+
512
+ return(ret);
513
+ }
514
+
local-test-libxml2-full-01/afc-libxml2/fuzz/html.c ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * html.c: a libFuzzer target to test several HTML parser interfaces.
3
+ *
4
+ * See Copyright for the status of this software.
5
+ */
6
+
7
+ #include <libxml/HTMLparser.h>
8
+ #include <libxml/HTMLtree.h>
9
+ #include <libxml/catalog.h>
10
+ #include "fuzz.h"
11
+
12
+ int
13
+ LLVMFuzzerInitialize(int *argc ATTRIBUTE_UNUSED,
14
+ char ***argv ATTRIBUTE_UNUSED) {
15
+ xmlFuzzMemSetup();
16
+ xmlInitParser();
17
+ #ifdef LIBXML_CATALOG_ENABLED
18
+ xmlInitializeCatalog();
19
+ xmlCatalogSetDefaults(XML_CATA_ALLOW_NONE);
20
+ #endif
21
+
22
+ return 0;
23
+ }
24
+
25
+ int
26
+ LLVMFuzzerTestOneInput(const char *data, size_t size) {
27
+ xmlParserCtxtPtr ctxt;
28
+ htmlDocPtr doc;
29
+ const char *docBuffer;
30
+ size_t failurePos, docSize;
31
+ int opts;
32
+
33
+ xmlFuzzDataInit(data, size);
34
+ opts = (int) xmlFuzzReadInt(4);
35
+ failurePos = xmlFuzzReadInt(4) % (size + 100);
36
+
37
+ docBuffer = xmlFuzzReadRemaining(&docSize);
38
+ if (docBuffer == NULL) {
39
+ xmlFuzzDataCleanup();
40
+ return(0);
41
+ }
42
+
43
+ /* Pull parser */
44
+
45
+ xmlFuzzInjectFailure(failurePos);
46
+ ctxt = htmlNewParserCtxt();
47
+ if (ctxt != NULL) {
48
+ xmlCtxtSetErrorHandler(ctxt, xmlFuzzSErrorFunc, NULL);
49
+ doc = htmlCtxtReadMemory(ctxt, docBuffer, docSize, NULL, NULL, opts);
50
+ xmlFuzzCheckFailureReport("htmlCtxtReadMemory",
51
+ ctxt->errNo == XML_ERR_NO_MEMORY,
52
+ ctxt->errNo == XML_IO_EIO);
53
+
54
+ if (doc != NULL) {
55
+ xmlDocPtr copy;
56
+
57
+ #ifdef LIBXML_OUTPUT_ENABLED
58
+ xmlOutputBufferPtr out;
59
+ const xmlChar *content;
60
+
61
+ /*
62
+ * Also test the serializer. Call htmlDocContentDumpOutput with our
63
+ * own buffer to avoid encoding the output. The HTML encoding is
64
+ * excruciatingly slow (see htmlEntityValueLookup).
65
+ */
66
+ out = xmlAllocOutputBuffer(NULL);
67
+ htmlDocContentDumpOutput(out, doc, NULL);
68
+ content = xmlOutputBufferGetContent(out);
69
+ xmlOutputBufferClose(out);
70
+ xmlFuzzCheckFailureReport("htmlDocContentDumpOutput",
71
+ content == NULL, 0);
72
+ #endif
73
+
74
+ copy = xmlCopyDoc(doc, 1);
75
+ xmlFuzzCheckFailureReport("xmlCopyNode", copy == NULL, 0);
76
+ xmlFreeDoc(copy);
77
+
78
+ xmlFreeDoc(doc);
79
+ }
80
+
81
+ htmlFreeParserCtxt(ctxt);
82
+ }
83
+
84
+
85
+ /* Push parser */
86
+
87
+ #ifdef LIBXML_PUSH_ENABLED
88
+ {
89
+ static const size_t maxChunkSize = 128;
90
+ size_t consumed, chunkSize;
91
+
92
+ xmlFuzzInjectFailure(failurePos);
93
+ ctxt = htmlCreatePushParserCtxt(NULL, NULL, NULL, 0, NULL,
94
+ XML_CHAR_ENCODING_NONE);
95
+
96
+ if (ctxt != NULL) {
97
+ xmlCtxtSetErrorHandler(ctxt, xmlFuzzSErrorFunc, NULL);
98
+ htmlCtxtUseOptions(ctxt, opts);
99
+
100
+ for (consumed = 0; consumed < docSize; consumed += chunkSize) {
101
+ chunkSize = docSize - consumed;
102
+ if (chunkSize > maxChunkSize)
103
+ chunkSize = maxChunkSize;
104
+ htmlParseChunk(ctxt, docBuffer + consumed, chunkSize, 0);
105
+ }
106
+
107
+ htmlParseChunk(ctxt, NULL, 0, 1);
108
+ xmlFuzzCheckFailureReport("htmlParseChunk",
109
+ ctxt->errNo == XML_ERR_NO_MEMORY,
110
+ ctxt->errNo == XML_IO_EIO);
111
+ xmlFreeDoc(ctxt->myDoc);
112
+ htmlFreeParserCtxt(ctxt);
113
+ }
114
+ }
115
+ #endif
116
+
117
+ /* Cleanup */
118
+
119
+ xmlFuzzInjectFailure(0);
120
+ xmlFuzzDataCleanup();
121
+ xmlResetLastError();
122
+
123
+ return(0);
124
+ }
125
+
local-test-libxml2-full-01/afc-libxml2/fuzz/html.dict ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ elem_a="<a></a>"
2
+ elem_abbr="<abbr></abbr>"
3
+ elem_acronym="<acronym></acronym>"
4
+ elem_address="<address></address>"
5
+ elem_applet="<applet></applet>"
6
+ elem_area="<area>"
7
+ elem_b="<b></b>"
8
+ elem_base="<base>"
9
+ elem_basefont="<basefont>"
10
+ elem_bdo="<bdo></bdo>"
11
+ elem_big="<big></big>"
12
+ elem_blockquote="<blockquote></blockquote>"
13
+ elem_body="<body></body>"
14
+ elem_br="<br>"
15
+ elem_button="<button></button>"
16
+ elem_caption="<caption></caption>"
17
+ elem_center="<center></center>"
18
+ elem_cite="<cite></cite>"
19
+ elem_code="<code></code>"
20
+ elem_col="<col>"
21
+ elem_colgroup="<colgroup></colgroup>"
22
+ elem_dd="<dd></dd>"
23
+ elem_del="<del></del>"
24
+ elem_dfn="<dfn></dfn>"
25
+ elem_dir="<dir></dir>"
26
+ elem_div="<div></div>"
27
+ elem_dl="<dl></dl>"
28
+ elem_dt="<dt></dt>"
29
+ elem_em="<em></em>"
30
+ elem_embed="<embed></embed>"
31
+ elem_fieldset="<fieldset></fieldset>"
32
+ elem_font="<font></font>"
33
+ elem_form="<form></form>"
34
+ elem_frame="<frame>"
35
+ elem_frameset="<frameset></frameset>"
36
+ elem_h1="<h1></h1>"
37
+ elem_h2="<h2></h2>"
38
+ elem_h3="<h3></h3>"
39
+ elem_h4="<h4></h4>"
40
+ elem_h5="<h5></h5>"
41
+ elem_h6="<h6></h6>"
42
+ elem_head="<head></head>"
43
+ elem_hr="<hr>"
44
+ elem_html="<html></html>"
45
+ elem_i="<i></i>"
46
+ elem_iframe="<iframe></iframe>"
47
+ elem_img="<img>"
48
+ elem_input="<input>"
49
+ elem_ins="<ins></ins>"
50
+ elem_isindex="<isindex>"
51
+ elem_kbd="<kbd></kbd>"
52
+ elem_label="<label></label>"
53
+ elem_legend="<legend></legend>"
54
+ elem_li="<li></li>"
55
+ elem_link="<link>"
56
+ elem_map="<map></map>"
57
+ elem_menu="<menu></menu>"
58
+ elem_meta="<meta>"
59
+ elem_noframes="<noframes></noframes>"
60
+ elem_noscript="<noscript></noscript>"
61
+ elem_object="<object></object>"
62
+ elem_ol="<ol></ol>"
63
+ elem_optgroup="<optgroup></optgroup>"
64
+ elem_option="<option></option>"
65
+ elem_p="<p></p>"
66
+ elem_param="<param>"
67
+ elem_pre="<pre></pre>"
68
+ elem_q="<q></q>"
69
+ elem_s="<s></s>"
70
+ elem_samp="<samp></samp>"
71
+ elem_script="<script></script>"
72
+ elem_select="<select></select>"
73
+ elem_small="<small></small>"
74
+ elem_span="<span></span>"
75
+ elem_strike="<strike></strike>"
76
+ elem_strong="<strong></strong>"
77
+ elem_style="<style></style>"
78
+ elem_sub="<sub></sub>"
79
+ elem_sup="<sup></sup>"
80
+ elem_table="<table></table>"
81
+ elem_tbody="<tbody></tbody>"
82
+ elem_td="<td></td>"
83
+ elem_textarea="<textarea></textarea>"
84
+ elem_tfoot="<tfoot></tfoot>"
85
+ elem_th="<th></th>"
86
+ elem_thead="<thead></thead>"
87
+ elem_title="<title></title>"
88
+ elem_tr="<tr></tr>"
89
+ elem_tt="<tt></tt>"
90
+ elem_u="<u></u>"
91
+ elem_ul="<ul></ul>"
92
+ elem_var="<var></var>"
93
+
94
+ attr_id=" id=\"\""
95
+ attr_style=" style=\"\""
96
+
97
+ comment="<!-- -->"
98
+
99
+ doctype="<!DOCTYPE d>"
100
+ doctype_system="<!DOCTYPE s SYSTEM \"u\">"
101
+ doctype_public="<!DOCTYPE p PUBLIC \"i\" \"u\">"
102
+
103
+ pi="<?a?>"
104
+
105
+ ref_lt="&lt;"
106
+ ref_gt="&gt;"
107
+ ref_amp="&amp;"
108
+ ref_apos="&apos;"
109
+ ref_quot="&quot;"
110
+ ref_dec="&#9;"
111
+ ref_hex="&#xA;"
112
+
113
+ cs_utf8="UTF-8"
114
+ cs_utf16="UTF-16"
115
+ cs_utf16le="UTF-16LE"
116
+ cs_utf16be="UTF-16BE"
117
+ cs_ucs2="UCS-2"
118
+ cs_ucs4="UCS-4"
119
+ cs_latin1="ISO-8859-1"
120
+ cs_ascii="ASCII"
121
+ cs_ebcdic="EBCDIC"
122
+ cs_iso2022jp="ISO-2022-JP"
123
+ cs_shift_jis="SHIFT_JIS"
124
+ cs_euc_jp="EUC-JP"
local-test-libxml2-full-01/afc-libxml2/fuzz/html.options ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ [libfuzzer]
2
+ timeout_exitcode=0
local-test-libxml2-full-01/afc-libxml2/fuzz/lint.c ADDED
@@ -0,0 +1,213 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * xml.c: a libFuzzer target to test several XML parser interfaces.
3
+ *
4
+ * See Copyright for the status of this software.
5
+ */
6
+
7
+ #include <fcntl.h>
8
+ #include <stdlib.h>
9
+ #include <stdio.h>
10
+ #include <unistd.h>
11
+
12
+ #include <libxml/catalog.h>
13
+ #include <libxml/parser.h>
14
+ #include <libxml/xmlerror.h>
15
+ #include <libxml/xmlmemory.h>
16
+
17
+ #include "fuzz.h"
18
+
19
+ #define XMLLINT_FUZZ
20
+ #include "../xmllint.c"
21
+
22
+ static const char *const switches[] = {
23
+ "--auto",
24
+ "--c14n",
25
+ "--c14n11",
26
+ "--compress",
27
+ "--copy",
28
+ "--debug",
29
+ "--debugent",
30
+ "--dropdtd",
31
+ "--dtdattr",
32
+ "--exc-c14n",
33
+ "--format",
34
+ "--htmlout",
35
+ "--huge",
36
+ "--insert",
37
+ "--loaddtd",
38
+ "--load-trace",
39
+ "--memory",
40
+ "--noblanks",
41
+ "--nocdata",
42
+ "--nocompact",
43
+ "--nodefdtd",
44
+ "--nodict",
45
+ "--noenc",
46
+ "--noent",
47
+ "--nofixup-base-uris",
48
+ "--nonet",
49
+ "--noout",
50
+ "--nowarning",
51
+ "--nowrap",
52
+ "--noxincludenode",
53
+ "--nsclean",
54
+ "--oldxml10",
55
+ "--pedantic",
56
+ "--postvalid",
57
+ "--push",
58
+ "--pushsmall",
59
+ "--quiet",
60
+ "--recover",
61
+ "--sax1",
62
+ "--testIO",
63
+ "--timing",
64
+ "--valid",
65
+ "--version",
66
+ "--walker",
67
+ "--xinclude",
68
+ "--xmlout"
69
+ };
70
+ static const size_t numSwitches = sizeof(switches) / sizeof(switches[0]);
71
+
72
+ struct {
73
+ const char **argv;
74
+ size_t argi;
75
+ } vars;
76
+
77
+ static void
78
+ pushArg(const char *str) {
79
+ vars.argv[vars.argi++] = str;
80
+ }
81
+
82
+ int
83
+ LLVMFuzzerInitialize(int *argc ATTRIBUTE_UNUSED,
84
+ char ***argv ATTRIBUTE_UNUSED) {
85
+ int fd;
86
+
87
+ /* Redirect stdout to /dev/null */
88
+ fd = open("/dev/null", O_WRONLY);
89
+ if (fd == -1) {
90
+ perror("/dev/null");
91
+ abort();
92
+ }
93
+ if (dup2(fd, STDOUT_FILENO) == -1) {
94
+ perror("dup2");
95
+ abort();
96
+ }
97
+ close(fd);
98
+
99
+ return 0;
100
+ }
101
+
102
+ int
103
+ LLVMFuzzerTestOneInput(const char *data, size_t size) {
104
+ char maxmemBuf[20];
105
+ char maxAmplBuf[20];
106
+ char prettyBuf[20];
107
+ const char *sval, *docBuffer, *docUrl;
108
+ size_t ssize, docSize, i;
109
+ unsigned uval;
110
+ int ival;
111
+
112
+ vars.argv = malloc((numSwitches + 5 + 6 * 2) * sizeof(vars.argv[0]));
113
+ vars.argi = 0;
114
+ pushArg("xmllint"),
115
+ pushArg("--nocatalogs");
116
+
117
+ xmlFuzzDataInit(data, size);
118
+
119
+ for (i = 0; i < numSwitches; i++) {
120
+ if (i % 32 == 0)
121
+ uval = xmlFuzzReadInt(4);
122
+ if ((uval & 1) && (switches[i] != NULL))
123
+ pushArg(switches[i]);
124
+ uval >>= 1;
125
+ }
126
+
127
+ /*
128
+ * Use four main parsing modes with equal probability
129
+ */
130
+ switch (uval & 3) {
131
+ case 0:
132
+ /* XML parser */
133
+ break;
134
+ case 1:
135
+ /* HTML parser */
136
+ pushArg("--html");
137
+ break;
138
+ case 2:
139
+ /* XML reader */
140
+ pushArg("--stream");
141
+ break;
142
+ case 3:
143
+ /* SAX parser */
144
+ pushArg("--sax");
145
+ break;
146
+ }
147
+
148
+ uval = xmlFuzzReadInt(4);
149
+ if (uval > 0) {
150
+ if (size <= (INT_MAX - 2000) / 20)
151
+ uval %= size * 20 + 2000;
152
+ else
153
+ uval %= INT_MAX;
154
+ snprintf(maxmemBuf, 20, "%u", uval);
155
+ pushArg("--maxmem");
156
+ pushArg(maxmemBuf);
157
+ }
158
+
159
+ ival = xmlFuzzReadInt(1);
160
+ if (ival >= 1 && ival <= 5) {
161
+ snprintf(maxAmplBuf, 20, "%d", ival);
162
+ pushArg("--max-ampl");
163
+ pushArg(maxAmplBuf);
164
+ }
165
+
166
+ ival = xmlFuzzReadInt(1);
167
+ if (ival != 0) {
168
+ snprintf(prettyBuf, 20, "%d", ival - 128);
169
+ pushArg("--pretty");
170
+ pushArg(prettyBuf);
171
+ }
172
+
173
+ sval = xmlFuzzReadString(&ssize);
174
+ if (ssize > 0) {
175
+ pushArg("--encode");
176
+ pushArg(sval);
177
+ }
178
+
179
+ sval = xmlFuzzReadString(&ssize);
180
+ if (ssize > 0) {
181
+ pushArg("--pattern");
182
+ pushArg(sval);
183
+ }
184
+
185
+ sval = xmlFuzzReadString(&ssize);
186
+ if (ssize > 0) {
187
+ pushArg("--xpath");
188
+ pushArg(sval);
189
+ }
190
+
191
+ xmlFuzzReadEntities();
192
+ docBuffer = xmlFuzzMainEntity(&docSize);
193
+ docUrl = xmlFuzzMainUrl();
194
+ if (docBuffer == NULL || docUrl[0] == '-')
195
+ goto exit;
196
+ pushArg(docUrl);
197
+
198
+ pushArg(NULL);
199
+
200
+ xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
201
+ #ifdef LIBXML_CATALOG_ENABLED
202
+ xmlCatalogSetDefaults(XML_CATA_ALLOW_NONE);
203
+ #endif
204
+
205
+ xmllintMain(vars.argi - 1, vars.argv, xmlFuzzResourceLoader);
206
+
207
+ xmlMemSetup(free, malloc, realloc, xmlMemStrdup);
208
+
209
+ exit:
210
+ xmlFuzzDataCleanup();
211
+ free(vars.argv);
212
+ return(0);
213
+ }
local-test-libxml2-full-01/afc-libxml2/fuzz/lint.options ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ [libfuzzer]
2
+ timeout_exitcode=0
local-test-libxml2-full-01/afc-libxml2/fuzz/oss-fuzz-build.sh ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash -eu
2
+
3
+ # OSS-Fuzz integration, see
4
+ # https://github.com/google/oss-fuzz/tree/master/projects/libxml2
5
+
6
+ # Add extra UBSan checks
7
+ if [ "$SANITIZER" = undefined ]; then
8
+ extra_checks="integer,float-divide-by-zero"
9
+ extra_cflags="-fsanitize=$extra_checks -fno-sanitize-recover=$extra_checks"
10
+ export CFLAGS="$CFLAGS $extra_cflags"
11
+ export CXXFLAGS="$CXXFLAGS $extra_cflags"
12
+ fi
13
+
14
+ # Don't enable zlib and liblzma with MSan
15
+ if [ "$SANITIZER" = memory ]; then
16
+ CONFIG=''
17
+ else
18
+ CONFIG='--with-zlib --with-lzma'
19
+ fi
20
+
21
+ # Workaround for a LeakSanitizer crashes,
22
+ # see https://github.com/google/oss-fuzz/issues/11798.
23
+ if [ "$ARCHITECTURE" = "aarch64" ]; then
24
+ export ASAN_OPTIONS=detect_leaks=0
25
+ fi
26
+
27
+ export V=1
28
+
29
+ ./autogen.sh \
30
+ --disable-shared \
31
+ --without-debug \
32
+ --without-http \
33
+ --without-python \
34
+ $CONFIG
35
+ make -j$(nproc)
36
+
37
+ cd fuzz
38
+ make clean-corpus
39
+ make fuzz.o
40
+
41
+ for fuzzer in \
42
+ api html lint reader regexp schema uri valid xinclude xml xpath
43
+ do
44
+ make $fuzzer.o
45
+ # Link with $CXX
46
+ $CXX $CXXFLAGS \
47
+ $fuzzer.o fuzz.o \
48
+ -o $OUT/$fuzzer \
49
+ $LIB_FUZZING_ENGINE \
50
+ ../.libs/libxml2.a -Wl,-Bstatic -lz -llzma -Wl,-Bdynamic
51
+
52
+ if [ $fuzzer != api ]; then
53
+ [ -e seed/$fuzzer ] || make seed/$fuzzer.stamp
54
+ zip -j $OUT/${fuzzer}_seed_corpus.zip seed/$fuzzer/*
55
+ fi
56
+ done
57
+
58
+ cp *.dict *.options $OUT/
local-test-libxml2-full-01/afc-libxml2/fuzz/reader.c ADDED
@@ -0,0 +1,555 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * xml.c: a libFuzzer target to test several XML parser interfaces.
3
+ *
4
+ * See Copyright for the status of this software.
5
+ */
6
+
7
+ #include <libxml/catalog.h>
8
+ #include <libxml/parser.h>
9
+ #include <libxml/tree.h>
10
+ #include <libxml/xmlerror.h>
11
+ #include <libxml/xmlreader.h>
12
+ #include <libxml/xmlsave.h>
13
+ #include "fuzz.h"
14
+
15
+ #include <string.h>
16
+
17
+ #if 0
18
+ #define DEBUG
19
+ #endif
20
+
21
+ typedef enum {
22
+ OP_READ = 1,
23
+ OP_READ_INNER_XML,
24
+ OP_READ_OUTER_XML,
25
+ OP_READ_STRING,
26
+ OP_READ_ATTRIBUTE_VALUE,
27
+ OP_ATTRIBUTE_COUNT,
28
+ OP_DEPTH,
29
+ OP_HAS_ATTRIBUTES,
30
+ OP_HAS_VALUE,
31
+ OP_IS_DEFAULT,
32
+ OP_IS_EMPTY_ELEMENT,
33
+ OP_NODE_TYPE,
34
+ OP_QUOTE_CHAR,
35
+ OP_READ_STATE,
36
+ OP_IS_NAMESPACE_DECL,
37
+ OP_CONST_BASE_URI,
38
+ OP_CONST_LOCAL_NAME,
39
+ OP_CONST_NAME,
40
+ OP_CONST_NAMESPACE_URI,
41
+ OP_CONST_PREFIX,
42
+ OP_CONST_XML_LANG,
43
+ OP_CONST_VALUE,
44
+ OP_BASE_URI,
45
+ OP_LOCAL_NAME,
46
+ OP_NAME,
47
+ OP_NAMESPACE_URI,
48
+ OP_PREFIX,
49
+ OP_XML_LANG,
50
+ OP_VALUE,
51
+ OP_CLOSE,
52
+ OP_GET_ATTRIBUTE_NO,
53
+ OP_GET_ATTRIBUTE,
54
+ OP_GET_ATTRIBUTE_NS,
55
+ OP_GET_REMAINDER,
56
+ OP_LOOKUP_NAMESPACE,
57
+ OP_MOVE_TO_ATTRIBUTE_NO,
58
+ OP_MOVE_TO_ATTRIBUTE,
59
+ OP_MOVE_TO_ATTRIBUTE_NS,
60
+ OP_MOVE_TO_FIRST_ATTRIBUTE,
61
+ OP_MOVE_TO_NEXT_ATTRIBUTE,
62
+ OP_MOVE_TO_ELEMENT,
63
+ OP_NORMALIZATION,
64
+ OP_CONST_ENCODING,
65
+ OP_GET_PARSER_PROP,
66
+ OP_CURRENT_NODE,
67
+ OP_GET_PARSER_LINE_NUMBER,
68
+ OP_GET_PARSER_COLUMN_NUMBER,
69
+ OP_PRESERVE,
70
+ OP_CURRENT_DOC,
71
+ OP_EXPAND,
72
+ OP_NEXT,
73
+ OP_NEXT_SIBLING,
74
+ OP_IS_VALID,
75
+ OP_CONST_XML_VERSION,
76
+ OP_STANDALONE,
77
+ OP_BYTE_CONSUMED,
78
+
79
+ OP_MAX
80
+ } opType;
81
+
82
+ static void
83
+ startOp(const char *name) {
84
+ (void) name;
85
+ #ifdef DEBUG
86
+ fprintf(stderr, "%s\n", name);
87
+ #endif
88
+ }
89
+
90
+ int
91
+ LLVMFuzzerInitialize(int *argc ATTRIBUTE_UNUSED,
92
+ char ***argv ATTRIBUTE_UNUSED) {
93
+ xmlFuzzMemSetup();
94
+ xmlInitParser();
95
+ #ifdef LIBXML_CATALOG_ENABLED
96
+ xmlInitializeCatalog();
97
+ xmlCatalogSetDefaults(XML_CATA_ALLOW_NONE);
98
+ #endif
99
+
100
+ return 0;
101
+ }
102
+
103
+ int
104
+ LLVMFuzzerTestOneInput(const char *data, size_t size) {
105
+ xmlTextReaderPtr reader;
106
+ xmlDocPtr doc = NULL;
107
+ const xmlError *error;
108
+ const char *docBuffer;
109
+ const unsigned char *program;
110
+ size_t failurePos, docSize, programSize, i;
111
+ size_t totalStringSize = 0;
112
+ int opts;
113
+ int oomReport = 0;
114
+
115
+ xmlFuzzDataInit(data, size);
116
+ opts = (int) xmlFuzzReadInt(4);
117
+ failurePos = xmlFuzzReadInt(4) % (size + 100);
118
+
119
+ program = (const unsigned char *) xmlFuzzReadString(&programSize);
120
+ if (programSize > 1000)
121
+ programSize = 1000;
122
+
123
+ xmlFuzzReadEntities();
124
+ docBuffer = xmlFuzzMainEntity(&docSize);
125
+ if (docBuffer == NULL)
126
+ goto exit;
127
+
128
+ #ifdef DEBUG
129
+ fprintf(stderr, "Input document (%d bytes):\n", (int) docSize);
130
+ for (i = 0; (size_t) i < docSize; i++) {
131
+ int c = (unsigned char) docBuffer[i];
132
+
133
+ if ((c == '\n' || (c >= 0x20 && c <= 0x7E)))
134
+ putc(c, stderr);
135
+ else
136
+ fprintf(stderr, "\\x%02X", c);
137
+ }
138
+ fprintf(stderr, "\nEOF\n");
139
+ #endif
140
+
141
+ xmlFuzzInjectFailure(failurePos);
142
+ reader = xmlReaderForMemory(docBuffer, docSize, NULL, NULL, opts);
143
+ if (reader == NULL)
144
+ goto exit;
145
+
146
+ xmlTextReaderSetStructuredErrorHandler(reader, xmlFuzzSErrorFunc, NULL);
147
+ xmlTextReaderSetResourceLoader(reader, xmlFuzzResourceLoader, NULL);
148
+
149
+ i = 0;
150
+ while (i < programSize) {
151
+ int op = program[i++];
152
+
153
+ #define READ_BYTE() (i < programSize ? program[i++] : 0)
154
+ #define FREE_STRING(str) \
155
+ do { \
156
+ if (str != NULL) { \
157
+ totalStringSize += strlen((char *) str); \
158
+ xmlFree(str); \
159
+ } \
160
+ } while (0)
161
+
162
+ switch (op & 0x3F) {
163
+ case OP_READ:
164
+ default:
165
+ startOp("Read");
166
+ xmlTextReaderRead(reader);
167
+ break;
168
+
169
+ case OP_READ_INNER_XML: {
170
+ xmlChar *result;
171
+
172
+ startOp("ReadInnerXml");
173
+ result = xmlTextReaderReadInnerXml(reader);
174
+ FREE_STRING(result);
175
+ break;
176
+ }
177
+
178
+ case OP_READ_OUTER_XML: {
179
+ xmlChar *result;
180
+
181
+ startOp("ReadOuterXml");
182
+ result = xmlTextReaderReadOuterXml(reader);
183
+ FREE_STRING(result);
184
+ break;
185
+ }
186
+
187
+ case OP_READ_STRING: {
188
+ xmlChar *result;
189
+
190
+ startOp("ReadString");
191
+ result = xmlTextReaderReadString(reader);
192
+ FREE_STRING(result);
193
+ break;
194
+ }
195
+
196
+ case OP_READ_ATTRIBUTE_VALUE:
197
+ startOp("ReadAttributeValue");
198
+ xmlTextReaderReadAttributeValue(reader);
199
+ break;
200
+
201
+ case OP_ATTRIBUTE_COUNT:
202
+ startOp("AttributeCount");
203
+ xmlTextReaderAttributeCount(reader);
204
+ break;
205
+
206
+ case OP_DEPTH:
207
+ startOp("Depth");
208
+ xmlTextReaderDepth(reader);
209
+ break;
210
+
211
+ case OP_HAS_ATTRIBUTES:
212
+ startOp("HasAttributes");
213
+ xmlTextReaderHasAttributes(reader);
214
+ break;
215
+
216
+ case OP_HAS_VALUE:
217
+ startOp("HasValue");
218
+ xmlTextReaderHasValue(reader);
219
+ break;
220
+
221
+ case OP_IS_DEFAULT:
222
+ startOp("IsDefault");
223
+ xmlTextReaderIsDefault(reader);
224
+ break;
225
+
226
+ case OP_IS_EMPTY_ELEMENT:
227
+ startOp("IsEmptyElement");
228
+ xmlTextReaderIsEmptyElement(reader);
229
+ break;
230
+
231
+ case OP_NODE_TYPE:
232
+ startOp("NodeType");
233
+ xmlTextReaderNodeType(reader);
234
+ break;
235
+
236
+ case OP_QUOTE_CHAR:
237
+ startOp("QuoteChar");
238
+ xmlTextReaderQuoteChar(reader);
239
+ break;
240
+
241
+ case OP_READ_STATE:
242
+ startOp("ReadState");
243
+ xmlTextReaderReadState(reader);
244
+ break;
245
+
246
+ case OP_IS_NAMESPACE_DECL:
247
+ startOp("IsNamespaceDecl");
248
+ xmlTextReaderIsNamespaceDecl(reader);
249
+ break;
250
+
251
+ case OP_CONST_BASE_URI:
252
+ startOp("ConstBaseUri");
253
+ xmlTextReaderConstBaseUri(reader);
254
+ break;
255
+
256
+ case OP_CONST_LOCAL_NAME:
257
+ startOp("ConstLocalName");
258
+ xmlTextReaderConstLocalName(reader);
259
+ break;
260
+
261
+ case OP_CONST_NAME:
262
+ startOp("ConstName");
263
+ xmlTextReaderConstName(reader);
264
+ break;
265
+
266
+ case OP_CONST_NAMESPACE_URI:
267
+ startOp("ConstNamespaceUri");
268
+ xmlTextReaderConstNamespaceUri(reader);
269
+ break;
270
+
271
+ case OP_CONST_PREFIX:
272
+ startOp("ConstPrefix");
273
+ xmlTextReaderConstPrefix(reader);
274
+ break;
275
+
276
+ case OP_CONST_XML_LANG:
277
+ startOp("ConstXmlLang");
278
+ xmlTextReaderConstXmlLang(reader);
279
+ oomReport = -1;
280
+ break;
281
+
282
+ case OP_CONST_VALUE:
283
+ startOp("ConstValue");
284
+ xmlTextReaderConstValue(reader);
285
+ break;
286
+
287
+ case OP_BASE_URI: {
288
+ xmlChar *result;
289
+
290
+ startOp("BaseUri");
291
+ result = xmlTextReaderBaseUri(reader);
292
+ FREE_STRING(result);
293
+ break;
294
+ }
295
+
296
+ case OP_LOCAL_NAME: {
297
+ xmlChar *result;
298
+
299
+ startOp("LocalName");
300
+ result = xmlTextReaderLocalName(reader);
301
+ FREE_STRING(result);
302
+ break;
303
+ }
304
+
305
+ case OP_NAME: {
306
+ xmlChar *result;
307
+
308
+ startOp("Name");
309
+ result = xmlTextReaderName(reader);
310
+ FREE_STRING(result);
311
+ break;
312
+ }
313
+
314
+ case OP_NAMESPACE_URI: {
315
+ xmlChar *result;
316
+
317
+ startOp("NamespaceUri");
318
+ result = xmlTextReaderNamespaceUri(reader);
319
+ FREE_STRING(result);
320
+ break;
321
+ }
322
+
323
+ case OP_PREFIX: {
324
+ xmlChar *result;
325
+
326
+ startOp("Prefix");
327
+ result = xmlTextReaderPrefix(reader);
328
+ FREE_STRING(result);
329
+ break;
330
+ }
331
+
332
+ case OP_XML_LANG: {
333
+ xmlChar *result;
334
+
335
+ startOp("XmlLang");
336
+ result = xmlTextReaderXmlLang(reader);
337
+ oomReport = -1;
338
+ FREE_STRING(result);
339
+ break;
340
+ }
341
+
342
+ case OP_VALUE: {
343
+ xmlChar *result;
344
+
345
+ startOp("Value");
346
+ result = xmlTextReaderValue(reader);
347
+ FREE_STRING(result);
348
+ break;
349
+ }
350
+
351
+ case OP_CLOSE:
352
+ startOp("Close");
353
+ if (doc == NULL)
354
+ doc = xmlTextReaderCurrentDoc(reader);
355
+ xmlTextReaderClose(reader);
356
+ break;
357
+
358
+ case OP_GET_ATTRIBUTE_NO: {
359
+ xmlChar *result;
360
+ int no = READ_BYTE();
361
+
362
+ startOp("GetAttributeNo");
363
+ result = xmlTextReaderGetAttributeNo(reader, no);
364
+ FREE_STRING(result);
365
+ break;
366
+ }
367
+
368
+ case OP_GET_ATTRIBUTE: {
369
+ const xmlChar *name = xmlTextReaderConstName(reader);
370
+ xmlChar *result;
371
+
372
+ startOp("GetAttribute");
373
+ result = xmlTextReaderGetAttribute(reader, name);
374
+ FREE_STRING(result);
375
+ break;
376
+ }
377
+
378
+ case OP_GET_ATTRIBUTE_NS: {
379
+ const xmlChar *localName, *namespaceUri;
380
+ xmlChar *result;
381
+
382
+ startOp("GetAttributeNs");
383
+ localName = xmlTextReaderConstLocalName(reader);
384
+ namespaceUri = xmlTextReaderConstNamespaceUri(reader);
385
+ result = xmlTextReaderGetAttributeNs(reader, localName,
386
+ namespaceUri);
387
+ FREE_STRING(result);
388
+ break;
389
+ }
390
+
391
+ case OP_GET_REMAINDER:
392
+ startOp("GetRemainder");
393
+ if (doc == NULL)
394
+ doc = xmlTextReaderCurrentDoc(reader);
395
+ xmlFreeParserInputBuffer(xmlTextReaderGetRemainder(reader));
396
+ break;
397
+
398
+ case OP_LOOKUP_NAMESPACE: {
399
+ const xmlChar *prefix = xmlTextReaderConstPrefix(reader);
400
+ xmlChar *result;
401
+
402
+ startOp("LookupNamespace");
403
+ result = xmlTextReaderLookupNamespace(reader, prefix);
404
+ FREE_STRING(result);
405
+ break;
406
+ }
407
+
408
+ case OP_MOVE_TO_ATTRIBUTE_NO: {
409
+ int no = READ_BYTE();
410
+
411
+ startOp("MoveToAttributeNo");
412
+ xmlTextReaderMoveToAttributeNo(reader, no);
413
+ break;
414
+ }
415
+
416
+ case OP_MOVE_TO_ATTRIBUTE: {
417
+ const xmlChar *name = xmlTextReaderConstName(reader);
418
+
419
+ startOp("MoveToAttribute");
420
+ xmlTextReaderMoveToAttribute(reader, name);
421
+ break;
422
+ }
423
+
424
+ case OP_MOVE_TO_ATTRIBUTE_NS: {
425
+ const xmlChar *localName, *namespaceUri;
426
+
427
+ startOp("MoveToAttributeNs");
428
+ localName = xmlTextReaderConstLocalName(reader);
429
+ namespaceUri = xmlTextReaderConstNamespaceUri(reader);
430
+ xmlTextReaderMoveToAttributeNs(reader, localName,
431
+ namespaceUri);
432
+ break;
433
+ }
434
+
435
+ case OP_MOVE_TO_FIRST_ATTRIBUTE:
436
+ startOp("MoveToFirstAttribute");
437
+ xmlTextReaderMoveToFirstAttribute(reader);
438
+ break;
439
+
440
+ case OP_MOVE_TO_NEXT_ATTRIBUTE:
441
+ startOp("MoveToNextAttribute");
442
+ xmlTextReaderMoveToNextAttribute(reader);
443
+ break;
444
+
445
+ case OP_MOVE_TO_ELEMENT:
446
+ startOp("MoveToElement");
447
+ xmlTextReaderMoveToElement(reader);
448
+ break;
449
+
450
+ case OP_NORMALIZATION:
451
+ startOp("Normalization");
452
+ xmlTextReaderNormalization(reader);
453
+ break;
454
+
455
+ case OP_CONST_ENCODING:
456
+ startOp("ConstEncoding");
457
+ xmlTextReaderConstEncoding(reader);
458
+ break;
459
+
460
+ case OP_GET_PARSER_PROP: {
461
+ int prop = READ_BYTE();
462
+
463
+ startOp("GetParserProp");
464
+ xmlTextReaderGetParserProp(reader, prop);
465
+ break;
466
+ }
467
+
468
+ case OP_CURRENT_NODE:
469
+ startOp("CurrentNode");
470
+ xmlTextReaderCurrentNode(reader);
471
+ break;
472
+
473
+ case OP_GET_PARSER_LINE_NUMBER:
474
+ startOp("GetParserLineNumber");
475
+ xmlTextReaderGetParserLineNumber(reader);
476
+ break;
477
+
478
+ case OP_GET_PARSER_COLUMN_NUMBER:
479
+ startOp("GetParserColumnNumber");
480
+ xmlTextReaderGetParserColumnNumber(reader);
481
+ break;
482
+
483
+ case OP_PRESERVE:
484
+ startOp("Preserve");
485
+ xmlTextReaderPreserve(reader);
486
+ break;
487
+
488
+ case OP_CURRENT_DOC: {
489
+ xmlDocPtr result;
490
+
491
+ startOp("CurrentDoc");
492
+ result = xmlTextReaderCurrentDoc(reader);
493
+ if (doc == NULL)
494
+ doc = result;
495
+ break;
496
+ }
497
+
498
+ case OP_EXPAND:
499
+ startOp("Expand");
500
+ xmlTextReaderExpand(reader);
501
+ break;
502
+
503
+ case OP_NEXT:
504
+ startOp("Next");
505
+ xmlTextReaderNext(reader);
506
+ break;
507
+
508
+ case OP_NEXT_SIBLING:
509
+ startOp("NextSibling");
510
+ xmlTextReaderNextSibling(reader);
511
+ break;
512
+
513
+ case OP_IS_VALID:
514
+ startOp("IsValid");
515
+ xmlTextReaderIsValid(reader);
516
+ break;
517
+
518
+ case OP_CONST_XML_VERSION:
519
+ startOp("ConstXmlVersion");
520
+ xmlTextReaderConstXmlVersion(reader);
521
+ break;
522
+
523
+ case OP_STANDALONE:
524
+ startOp("Standalone");
525
+ xmlTextReaderStandalone(reader);
526
+ break;
527
+
528
+ case OP_BYTE_CONSUMED:
529
+ startOp("ByteConsumed");
530
+ xmlTextReaderByteConsumed(reader);
531
+ oomReport = -1;
532
+ break;
533
+ }
534
+
535
+ if (totalStringSize > docSize * 2)
536
+ break;
537
+ }
538
+
539
+ error = xmlTextReaderGetLastError(reader);
540
+ if (error->code == XML_ERR_NO_MEMORY)
541
+ oomReport = 1;
542
+ xmlFuzzCheckFailureReport("reader", oomReport, error->code == XML_IO_EIO);
543
+
544
+ xmlFreeTextReader(reader);
545
+
546
+ if (doc != NULL)
547
+ xmlFreeDoc(doc);
548
+
549
+ exit:
550
+ xmlFuzzInjectFailure(0);
551
+ xmlFuzzDataCleanup();
552
+ xmlResetLastError();
553
+ return(0);
554
+ }
555
+
local-test-libxml2-full-01/afc-libxml2/fuzz/reader.options ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ [libfuzzer]
2
+ dict = xml.dict
3
+ timeout_exitcode=0
local-test-libxml2-full-01/afc-libxml2/fuzz/regexp.c ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * regexp.c: a libFuzzer target to test the regexp module.
3
+ *
4
+ * See Copyright for the status of this software.
5
+ */
6
+
7
+ #include <stdio.h>
8
+ #include <stdlib.h>
9
+ #include <libxml/xmlregexp.h>
10
+ #include "fuzz.h"
11
+
12
+ int
13
+ LLVMFuzzerInitialize(int *argc ATTRIBUTE_UNUSED,
14
+ char ***argv ATTRIBUTE_UNUSED) {
15
+ xmlFuzzMemSetup();
16
+
17
+ return 0;
18
+ }
19
+
20
+ int
21
+ LLVMFuzzerTestOneInput(const char *data, size_t size) {
22
+ xmlRegexpPtr regexp;
23
+ size_t failurePos;
24
+ const char *str1;
25
+
26
+ if (size > 200)
27
+ return(0);
28
+
29
+ xmlFuzzDataInit(data, size);
30
+ failurePos = xmlFuzzReadInt(4) % (size * 8 + 100);
31
+ str1 = xmlFuzzReadString(NULL);
32
+
33
+ xmlFuzzInjectFailure(failurePos);
34
+ regexp = xmlRegexpCompile(BAD_CAST str1);
35
+ if (xmlFuzzMallocFailed() && regexp != NULL) {
36
+ fprintf(stderr, "malloc failure not reported\n");
37
+ abort();
38
+ }
39
+ /* xmlRegexpExec has pathological performance in too many cases. */
40
+ #if 0
41
+ xmlRegexpExec(regexp, BAD_CAST str2);
42
+ #endif
43
+ xmlRegFreeRegexp(regexp);
44
+
45
+ xmlFuzzInjectFailure(0);
46
+ xmlFuzzDataCleanup();
47
+ xmlResetLastError();
48
+
49
+ return 0;
50
+ }
51
+
local-test-libxml2-full-01/afc-libxml2/fuzz/regexp.dict ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ quant_any="*"
2
+ quant_opt="?"
3
+ quant_some="+"
4
+ quant_num="{1,2}"
5
+
6
+ dot="."
7
+ branch="|a"
8
+ parens="()"
9
+ parens_inner=")("
10
+ pos_group="[a]"
11
+ neg_group="[^a]"
12
+ class_subtraction="[a-[b]]"
13
+
14
+ esc_space="\\s"
15
+ esc_initial="\\i"
16
+ esc_name="\\c"
17
+ esc_digit="\\d"
18
+ esc_word="\\w"
19
+
20
+ cat_letter="\\p{L}"
21
+ cat_mark="\\p{M}"
22
+ cat_number="\\p{N}"
23
+ cat_punct="\\p{P}"
24
+ cat_sym="\\p{S}"
25
+ cat_sep="\\p{Z}"
26
+ cat_other="\\p{C}"
27
+
28
+ block_aegean_numbers="\\p{IsAegeanNumbers}"
29
+ block_alphabetic_presentation_forms="\\p{IsAlphabeticPresentationForms}"
30
+ block_arabic="\\p{IsArabic}"
31
+ block_arabic_presentation_forms_a="\\p{IsArabicPresentationFormsA}"
32
+ block_arabic_presentation_forms_b="\\p{IsArabicPresentationFormsB}"
33
+ block_armenian="\\p{IsArmenian}"
34
+ block_arrows="\\p{IsArrows}"
35
+ block_basic_latin="\\p{IsBasicLatin}"
36
+ block_bengali="\\p{IsBengali}"
37
+ block_block_elements="\\p{IsBlockElements}"
38
+ block_bopomofo="\\p{IsBopomofo}"
39
+ block_bopomofo_extended="\\p{IsBopomofoExtended}"
40
+ block_box_drawing="\\p{IsBoxDrawing}"
41
+ block_braille_patterns="\\p{IsBraillePatterns}"
42
+ block_buhid="\\p{IsBuhid}"
43
+ block_byzantine_musical_symbols="\\p{IsByzantineMusicalSymbols}"
44
+ block_c_j_k_compatibility="\\p{IsCJKCompatibility}"
45
+ block_c_j_k_compatibility_forms="\\p{IsCJKCompatibilityForms}"
46
+ block_c_j_k_compatibility_ideographs="\\p{IsCJKCompatibilityIdeographs}"
47
+ block_c_j_k_compatibility_ideographs_supplement="\\p{IsCJKCompatibilityIdeographsSupplement}"
48
+ block_c_j_k_radicals_supplement="\\p{IsCJKRadicalsSupplement}"
49
+ block_c_j_k_symbolsand_punctuation="\\p{IsCJKSymbolsandPunctuation}"
50
+ block_c_j_k_unified_ideographs="\\p{IsCJKUnifiedIdeographs}"
51
+ block_c_j_k_unified_ideographs_extension_a="\\p{IsCJKUnifiedIdeographsExtensionA}"
52
+ block_cjk_unified_ideographs_extension_b="\\p{IsCJKUnifiedIdeographsExtensionB}"
53
+ block_cherokee="\\p{IsCherokee}"
54
+ block_combining_diacritical_marks="\\p{IsCombiningDiacriticalMarks}"
55
+ block_combining_diacritical_marksfor_symbols="\\p{IsCombiningDiacriticalMarksforSymbols}"
56
+ block_combining_half_marks="\\p{IsCombiningHalfMarks}"
57
+ block_combining_marksfor_symbols="\\p{IsCombiningMarksforSymbols}"
58
+ block_control_pictures="\\p{IsControlPictures}"
59
+ block_currency_symbols="\\p{IsCurrencySymbols}"
60
+ block_cypriot_syllabary="\\p{IsCypriotSyllabary}"
61
+ block_cyrillic="\\p{IsCyrillic}"
62
+ block_cyrillic_supplement="\\p{IsCyrillicSupplement}"
63
+ block_deseret="\\p{IsDeseret}"
64
+ block_devanagari="\\p{IsDevanagari}"
65
+ block_dingbats="\\p{IsDingbats}"
66
+ block_enclosed_alphanumerics="\\p{IsEnclosedAlphanumerics}"
67
+ block_enclosed_cjk_lettersand_months="\\p{IsEnclosedCJKLettersandMonths}"
68
+ block_ethiopic="\\p{IsEthiopic}"
69
+ block_general_punctuation="\\p{IsGeneralPunctuation}"
70
+ block_geometric_shapes="\\p{IsGeometricShapes}"
71
+ block_georgian="\\p{IsGeorgian}"
72
+ block_gothic="\\p{IsGothic}"
73
+ block_greek="\\p{IsGreek}"
74
+ block_greek_extended="\\p{IsGreekExtended}"
75
+ block_greekand_coptic="\\p{IsGreekandCoptic}"
76
+ block_gujarati="\\p{IsGujarati}"
77
+ block_gurmukhi="\\p{IsGurmukhi}"
78
+ block_halfwidthand_fullwidth_forms="\\p{IsHalfwidthandFullwidthForms}"
79
+ block_hangul_compatibility_jamo="\\p{IsHangulCompatibilityJamo}"
80
+ block_hangul_jamo="\\p{IsHangulJamo}"
81
+ block_hangul_syllables="\\p{IsHangulSyllables}"
82
+ block_hanunoo="\\p{IsHanunoo}"
83
+ block_hebrew="\\p{IsHebrew}"
84
+ block_high_private_use_surrogates="\\p{IsHighPrivateUseSurrogates}"
85
+ block_high_surrogates="\\p{IsHighSurrogates}"
86
+ block_hiragana="\\p{IsHiragana}"
87
+ block_ipa_extensions="\\p{IsIPAExtensions}"
88
+ block_ideographic_description_characters="\\p{IsIdeographicDescriptionCharacters}"
89
+ block_kanbun="\\p{IsKanbun}"
90
+ block_kangxi_radicals="\\p{IsKangxiRadicals}"
91
+ block_kannada="\\p{IsKannada}"
92
+ block_katakana="\\p{IsKatakana}"
93
+ block_katakana_phonetic_extensions="\\p{IsKatakanaPhoneticExtensions}"
94
+ block_khmer="\\p{IsKhmer}"
95
+ block_khmer_symbols="\\p{IsKhmerSymbols}"
96
+ block_lao="\\p{IsLao}"
97
+ block_latin1Supplement="\\p{IsLatin1Supplement}"
98
+ block_latin_extended_a="\\p{IsLatinExtendedA}"
99
+ block_latin_extended_b="\\p{IsLatinExtendedB}"
100
+ block_latin_extended_additional="\\p{IsLatinExtendedAdditional}"
101
+ block_letterlike_symbols="\\p{IsLetterlikeSymbols}"
102
+ block_limbu="\\p{IsLimbu}"
103
+ block_linear_b_ideograms="\\p{IsLinearBIdeograms}"
104
+ block_linear_b_syllabary="\\p{IsLinearBSyllabary}"
105
+ block_low_surrogates="\\p{IsLowSurrogates}"
106
+ block_malayalam="\\p{IsMalayalam}"
107
+ block_mathematical_alphanumeric_symbols="\\p{IsMathematicalAlphanumericSymbols}"
108
+ block_mathematical_operators="\\p{IsMathematicalOperators}"
109
+ block_miscellaneous_mathematical_symbols_a="\\p{IsMiscellaneousMathematicalSymbolsA}"
110
+ block_miscellaneous_mathematical_symbols_b="\\p{IsMiscellaneousMathematicalSymbolsB}"
111
+ block_miscellaneous_symbols="\\p{IsMiscellaneousSymbols}"
112
+ block_miscellaneous_symbolsand_arrows="\\p{IsMiscellaneousSymbolsandArrows}"
113
+ block_miscellaneous_technical="\\p{IsMiscellaneousTechnical}"
114
+ block_mongolian="\\p{IsMongolian}"
115
+ block_musical_symbols="\\p{IsMusicalSymbols}"
116
+ block_myanmar="\\p{IsMyanmar}"
117
+ block_number_forms="\\p{IsNumberForms}"
118
+ block_ogham="\\p{IsOgham}"
119
+ block_old_italic="\\p{IsOldItalic}"
120
+ block_optical_character_recognition="\\p{IsOpticalCharacterRecognition}"
121
+ block_oriya="\\p{IsOriya}"
122
+ block_osmanya="\\p{IsOsmanya}"
123
+ block_phonetic_extensions="\\p{IsPhoneticExtensions}"
124
+ block_private_use="\\p{IsPrivateUse}"
125
+ block_private_use_area="\\p{IsPrivateUseArea}"
126
+ block_runic="\\p{IsRunic}"
127
+ block_shavian="\\p{IsShavian}"
128
+ block_sinhala="\\p{IsSinhala}"
129
+ block_small_form_variants="\\p{IsSmallFormVariants}"
130
+ block_spacing_modifier_letters="\\p{IsSpacingModifierLetters}"
131
+ block_specials="\\p{IsSpecials}"
132
+ block_superscriptsand_subscripts="\\p{IsSuperscriptsandSubscripts}"
133
+ block_supplemental_arrows_a="\\p{IsSupplementalArrowsA}"
134
+ block_supplemental_arrows_b="\\p{IsSupplementalArrowsB}"
135
+ block_supplemental_mathematical_operators="\\p{IsSupplementalMathematicalOperators}"
136
+ block_supplementary_private_use_area_a="\\p{IsSupplementaryPrivateUseAreaA}"
137
+ block_supplementary_private_use_area_b="\\p{IsSupplementaryPrivateUseAreaB}"
138
+ block_syriac="\\p{IsSyriac}"
139
+ block_tagalog="\\p{IsTagalog}"
140
+ block_tagbanwa="\\p{IsTagbanwa}"
141
+ block_tags="\\p{IsTags}"
142
+ block_tai_le="\\p{IsTaiLe}"
143
+ block_tai_xuan_jing_symbols="\\p{IsTaiXuanJingSymbols}"
144
+ block_tamil="\\p{IsTamil}"
145
+ block_telugu="\\p{IsTelugu}"
146
+ block_thaana="\\p{IsThaana}"
147
+ block_thai="\\p{IsThai}"
148
+ block_tibetan="\\p{IsTibetan}"
149
+ block_ugaritic="\\p{IsUgaritic}"
150
+ block_unified_canadian_aboriginal_syllabics="\\p{IsUnifiedCanadianAboriginalSyllabics}"
151
+ block_variation_selectors="\\p{IsVariationSelectors}"
152
+ block_variation_selectors_supplement="\\p{IsVariationSelectorsSupplement}"
153
+ block_yi_radicals="\\p{IsYiRadicals}"
154
+ block_yi_syllables="\\p{IsYiSyllables}"
155
+ block_yijing_hexagram_symbols="\\p{IsYijingHexagramSymbols}"
local-test-libxml2-full-01/afc-libxml2/fuzz/regexp.options ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ [libfuzzer]
2
+ timeout_exitcode=0
local-test-libxml2-full-01/afc-libxml2/fuzz/schema.c ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * schema.c: a libFuzzer target to test the XML Schema processor.
3
+ *
4
+ * See Copyright for the status of this software.
5
+ */
6
+
7
+ #include <libxml/catalog.h>
8
+ #include <libxml/xmlschemas.h>
9
+ #include "fuzz.h"
10
+
11
+ int
12
+ LLVMFuzzerInitialize(int *argc ATTRIBUTE_UNUSED,
13
+ char ***argv ATTRIBUTE_UNUSED) {
14
+ xmlFuzzMemSetup();
15
+ xmlInitParser();
16
+ #ifdef LIBXML_CATALOG_ENABLED
17
+ xmlInitializeCatalog();
18
+ xmlCatalogSetDefaults(XML_CATA_ALLOW_NONE);
19
+ #endif
20
+
21
+ return 0;
22
+ }
23
+
24
+ int
25
+ LLVMFuzzerTestOneInput(const char *data, size_t size) {
26
+ xmlSchemaParserCtxtPtr pctxt;
27
+ size_t failurePos;
28
+
29
+ if (size > 50000)
30
+ return(0);
31
+
32
+ failurePos = xmlFuzzReadInt(4) % (size + 100);
33
+
34
+ xmlFuzzDataInit(data, size);
35
+ xmlFuzzReadEntities();
36
+
37
+ xmlFuzzInjectFailure(failurePos);
38
+ pctxt = xmlSchemaNewParserCtxt(xmlFuzzMainUrl());
39
+ xmlSchemaSetParserStructuredErrors(pctxt, xmlFuzzSErrorFunc, NULL);
40
+ xmlSchemaSetResourceLoader(pctxt, xmlFuzzResourceLoader, NULL);
41
+ xmlSchemaFree(xmlSchemaParse(pctxt));
42
+ xmlSchemaFreeParserCtxt(pctxt);
43
+
44
+ xmlFuzzInjectFailure(0);
45
+ xmlFuzzDataCleanup();
46
+ xmlResetLastError();
47
+
48
+ return(0);
49
+ }
50
+
local-test-libxml2-full-01/afc-libxml2/fuzz/schema.dict ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # TODO: Add more language elements
2
+
3
+ xs_annotation="<xs:annotation></xs:annotation>"
4
+
5
+ xs_attribute="<xs:attribute name='a'></xs:attribute>"
6
+ xs_attribute_required="<xs:attribute name='a' use='required'></xs:attribute>"
7
+ xs_element="<xs:element name='e'></xs:element>"
8
+
9
+ # Primitive datatypes
10
+ type_string=" type='xs:string'"
11
+ type_boolean=" type='xs:boolean'"
12
+ type_decimal=" type='xs:decimal'"
13
+ type_float=" type='xs:float'"
14
+ type_double=" type='xs:double'"
15
+ type_date_time=" type='xs:dateTime'"
16
+ type_time=" type='xs:time'"
17
+ type_date=" type='xs:date'"
18
+ type_g_year_month=" type='xs:gYearMonth'"
19
+ type_g_year=" type='xs:gYear'"
20
+ type_g_month_day=" type='xs:gMonthDay'"
21
+ type_g_day=" type='xs:gDay'"
22
+ type_g_month=" type='xs:gMonth'"
23
+ type_hex_binary=" type='xs:hexBinary'"
24
+ type_base64_binary=" type='xs:base64Binary'"
25
+ type_any_uri=" type='xs:anyURI'"
26
+ type_qname=" type='xs:QName'"
27
+ type_notation=" type='xs:NOTATION'"
28
+
29
+ # Occurs
30
+ occurs_min=" minOccurs='1'"
31
+ occurs_max=" maxOccurs='9'"
32
+ occurs_max_unbounded=" maxOccurs='unbounded'"
33
+
34
+ # Simple type
35
+ xs_restriction_integer="<xs:simpleType><xs:restriction base='xs:integer'></xs:restriction></xs:simpleType>"
36
+ xs_restriction_string="<xs:simpleType><xs:restriction base='xs:string'></xs:restriction></xs:simpleType>"
37
+ xs_list="<xs:simpleType><xs:list></xs:list></xs:simpleType>"
38
+ xs_union="<xs:simpleType><xs:union></xs:union></xs:simpleType>"
39
+
40
+ # Restrictions
41
+ xs_min_exclusive="<xs:minExclusive value='0'/>"
42
+ xs_min_inclusive="<xs:minInclusive value='0'/>"
43
+ xs_max_exclusive="<xs:maxExclusive value='9'/>"
44
+ xs_max_inclusive="<xs:maxInclusive value='9'/>"
45
+ xs_total_digits="<xs:totalDigits value='3'/>"
46
+ xs_fraction_digits="<xs:fractionDigits value='3'/>"
47
+ xs_length="<xs:length value='3'/>"
48
+ xs_min_length="<xs:minLength value='3'/>"
49
+ xs_max_length="<xs:maxLength value='3'/>"
50
+ xs_enumeration="<xs:enumeration value='a'/>"
51
+ xs_white_space_collapse="<xs:whiteSpace value='collapse'/>"
52
+ xs_white_space_preserve="<xs:whiteSpace value='preserve'/>"
53
+ xs_white_space_replace="<xs:whiteSpace value='replace'/>"
54
+ xs_pattern="<xs:pattern value='a'/>"
55
+
local-test-libxml2-full-01/afc-libxml2/fuzz/schema.options ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ [libfuzzer]
2
+ timeout_exitcode=0
local-test-libxml2-full-01/afc-libxml2/fuzz/testFuzzer.c ADDED
@@ -0,0 +1,249 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * testFuzzer.c: Test program for the custom entity loader used to fuzz
3
+ * with multiple inputs.
4
+ *
5
+ * See Copyright for the status of this software.
6
+ */
7
+
8
+ #include <string.h>
9
+ #include <glob.h>
10
+ #include <libxml/parser.h>
11
+ #include <libxml/tree.h>
12
+ #include <libxml/xmlstring.h>
13
+ #include "fuzz.h"
14
+
15
+ #ifdef HAVE_HTML_FUZZER
16
+ int fuzzHtmlInit(int *argc, char ***argv);
17
+ int fuzzHtml(const char *data, size_t size);
18
+ #define LLVMFuzzerInitialize fuzzHtmlInit
19
+ #define LLVMFuzzerTestOneInput fuzzHtml
20
+ #include "html.c"
21
+ #undef LLVMFuzzerInitialize
22
+ #undef LLVMFuzzerTestOneInput
23
+ #endif
24
+
25
+ #ifdef HAVE_READER_FUZZER
26
+ int fuzzReaderInit(int *argc, char ***argv);
27
+ int fuzzReader(const char *data, size_t size);
28
+ #define LLVMFuzzerInitialize fuzzReaderInit
29
+ #define LLVMFuzzerTestOneInput fuzzReader
30
+ #include "reader.c"
31
+ #undef LLVMFuzzerInitialize
32
+ #undef LLVMFuzzerTestOneInput
33
+ #endif
34
+
35
+ #ifdef HAVE_REGEXP_FUZZER
36
+ int fuzzRegexpInit(int *argc, char ***argv);
37
+ int fuzzRegexp(const char *data, size_t size);
38
+ #define LLVMFuzzerInitialize fuzzRegexpInit
39
+ #define LLVMFuzzerTestOneInput fuzzRegexp
40
+ #include "regexp.c"
41
+ #undef LLVMFuzzerInitialize
42
+ #undef LLVMFuzzerTestOneInput
43
+ #endif
44
+
45
+ #ifdef HAVE_SCHEMA_FUZZER
46
+ int fuzzSchemaInit(int *argc, char ***argv);
47
+ int fuzzSchema(const char *data, size_t size);
48
+ #define LLVMFuzzerInitialize fuzzSchemaInit
49
+ #define LLVMFuzzerTestOneInput fuzzSchema
50
+ #include "schema.c"
51
+ #undef LLVMFuzzerInitialize
52
+ #undef LLVMFuzzerTestOneInput
53
+ #endif
54
+
55
+ #ifdef HAVE_URI_FUZZER
56
+ int fuzzUriInit(int *argc, char ***argv);
57
+ int fuzzUri(const char *data, size_t size);
58
+ #define LLVMFuzzerInitialize fuzzUriInit
59
+ #define LLVMFuzzerTestOneInput fuzzUri
60
+ #include "uri.c"
61
+ #undef LLVMFuzzerInitialize
62
+ #undef LLVMFuzzerTestOneInput
63
+ #endif
64
+
65
+ #ifdef HAVE_VALID_FUZZER
66
+ int fuzzValidInit(int *argc, char ***argv);
67
+ int fuzzValid(const char *data, size_t size);
68
+ #define LLVMFuzzerInitialize fuzzValidInit
69
+ #define LLVMFuzzerTestOneInput fuzzValid
70
+ #include "valid.c"
71
+ #undef LLVMFuzzerInitialize
72
+ #undef LLVMFuzzerTestOneInput
73
+ #endif
74
+
75
+ #ifdef HAVE_XINCLUDE_FUZZER
76
+ int fuzzXIncludeInit(int *argc, char ***argv);
77
+ int fuzzXInclude(const char *data, size_t size);
78
+ #define LLVMFuzzerInitialize fuzzXIncludeInit
79
+ #define LLVMFuzzerTestOneInput fuzzXInclude
80
+ #include "xinclude.c"
81
+ #undef LLVMFuzzerInitialize
82
+ #undef LLVMFuzzerTestOneInput
83
+ #endif
84
+
85
+ #ifdef HAVE_XML_FUZZER
86
+ int fuzzXmlInit(int *argc, char ***argv);
87
+ int fuzzXml(const char *data, size_t size);
88
+ #define LLVMFuzzerInitialize fuzzXmlInit
89
+ #define LLVMFuzzerTestOneInput fuzzXml
90
+ #include "xml.c"
91
+ #undef LLVMFuzzerInitialize
92
+ #undef LLVMFuzzerTestOneInput
93
+ #endif
94
+
95
+ #ifdef HAVE_XPATH_FUZZER
96
+ int fuzzXPathInit(int *argc, char ***argv);
97
+ int fuzzXPath(const char *data, size_t size);
98
+ #define LLVMFuzzerInitialize fuzzXPathInit
99
+ #define LLVMFuzzerTestOneInput fuzzXPath
100
+ #include "xpath.c"
101
+ #undef LLVMFuzzerInitialize
102
+ #undef LLVMFuzzerTestOneInput
103
+ #endif
104
+
105
+ typedef int
106
+ (*initFunc)(int *argc, char ***argv);
107
+ typedef int
108
+ (*fuzzFunc)(const char *data, size_t size);
109
+
110
+ int numInputs;
111
+
112
+ static int
113
+ testFuzzer(initFunc init, fuzzFunc fuzz, const char *pattern) {
114
+ glob_t globbuf;
115
+ int ret = -1;
116
+ size_t i;
117
+
118
+ if (glob(pattern, 0, NULL, &globbuf) != 0) {
119
+ fprintf(stderr, "pattern %s matches no files\n", pattern);
120
+ return(-1);
121
+ }
122
+
123
+ if (init != NULL)
124
+ init(NULL, NULL);
125
+
126
+ for (i = 0; i < globbuf.gl_pathc; i++) {
127
+ const char *path = globbuf.gl_pathv[i];
128
+ char *data;
129
+ size_t size;
130
+
131
+ data = xmlSlurpFile(path, &size);
132
+ if (data == NULL) {
133
+ fprintf(stderr, "couldn't read %s\n", path);
134
+ goto error;
135
+ }
136
+ fuzz(data, size);
137
+ xmlFree(data);
138
+
139
+ numInputs++;
140
+ }
141
+
142
+ ret = 0;
143
+ error:
144
+ globfree(&globbuf);
145
+ return(ret);
146
+ }
147
+
148
+ #ifdef HAVE_XML_FUZZER
149
+ static int
150
+ testEntityLoader(void) {
151
+ xmlParserCtxtPtr ctxt;
152
+ static const char data[] =
153
+ "doc.xml\\\n"
154
+ "<!DOCTYPE doc SYSTEM \"doc.dtd\">\n"
155
+ "<doc>&ent;</doc>\\\n"
156
+ "doc.dtd\\\n"
157
+ "<!ELEMENT doc (#PCDATA)>\n"
158
+ "<!ENTITY ent SYSTEM \"ent.txt\">\\\n"
159
+ "ent.txt\\\n"
160
+ "Hello, world!\\\n";
161
+ const char *docBuffer;
162
+ size_t docSize;
163
+ xmlDocPtr doc;
164
+ int ret = 0;
165
+
166
+ xmlFuzzDataInit(data, sizeof(data) - 1);
167
+ xmlFuzzReadEntities();
168
+ docBuffer = xmlFuzzMainEntity(&docSize);
169
+ ctxt = xmlNewParserCtxt();
170
+ xmlCtxtSetResourceLoader(ctxt, xmlFuzzResourceLoader, NULL);
171
+ doc = xmlCtxtReadMemory(ctxt, docBuffer, docSize, NULL, NULL,
172
+ XML_PARSE_NOENT | XML_PARSE_DTDLOAD);
173
+ xmlFreeParserCtxt(ctxt);
174
+
175
+ #ifdef LIBXML_OUTPUT_ENABLED
176
+ {
177
+ static xmlChar expected[] =
178
+ "<?xml version=\"1.0\"?>\n"
179
+ "<!DOCTYPE doc SYSTEM \"doc.dtd\">\n"
180
+ "<doc>Hello, world!</doc>\n";
181
+ xmlChar *out;
182
+
183
+ xmlDocDumpMemory(doc, &out, NULL);
184
+ if (xmlStrcmp(out, expected) != 0) {
185
+ fprintf(stderr, "Expected:\n%sGot:\n%s", expected, out);
186
+ ret = 1;
187
+ }
188
+ xmlFree(out);
189
+ }
190
+ #endif
191
+
192
+ xmlFreeDoc(doc);
193
+ xmlFuzzDataCleanup();
194
+
195
+ return(ret);
196
+ }
197
+ #endif
198
+
199
+ int
200
+ main(void) {
201
+ int ret = 0;
202
+
203
+ #ifdef HAVE_XML_FUZZER
204
+ if (testEntityLoader() != 0)
205
+ ret = 1;
206
+ #endif
207
+ #ifdef HAVE_HTML_FUZZER
208
+ if (testFuzzer(fuzzHtmlInit, fuzzHtml, "seed/html/*") != 0)
209
+ ret = 1;
210
+ #endif
211
+ #ifdef HAVE_READER_FUZZER
212
+ if (testFuzzer(fuzzReaderInit, fuzzReader, "seed/reader/*") != 0)
213
+ ret = 1;
214
+ #endif
215
+ #ifdef HAVE_REGEXP_FUZZER
216
+ if (testFuzzer(fuzzRegexpInit, fuzzRegexp, "seed/regexp/*") != 0)
217
+ ret = 1;
218
+ #endif
219
+ #ifdef HAVE_SCHEMA_FUZZER
220
+ if (testFuzzer(fuzzSchemaInit, fuzzSchema, "seed/schema/*") != 0)
221
+ ret = 1;
222
+ #endif
223
+ #ifdef HAVE_URI_FUZZER
224
+ if (testFuzzer(fuzzUriInit, fuzzUri, "seed/uri/*") != 0)
225
+ ret = 1;
226
+ #endif
227
+ #ifdef HAVE_VALID_FUZZER
228
+ if (testFuzzer(fuzzValidInit, fuzzValid, "seed/valid/*") != 0)
229
+ ret = 1;
230
+ #endif
231
+ #ifdef HAVE_XINCLUDE_FUZZER
232
+ if (testFuzzer(fuzzXIncludeInit, fuzzXInclude, "seed/xinclude/*") != 0)
233
+ ret = 1;
234
+ #endif
235
+ #ifdef HAVE_XML_FUZZER
236
+ if (testFuzzer(fuzzXmlInit, fuzzXml, "seed/xml/*") != 0)
237
+ ret = 1;
238
+ #endif
239
+ #ifdef HAVE_XPATH_FUZZER
240
+ if (testFuzzer(fuzzXPathInit, fuzzXPath, "seed/xpath/*") != 0)
241
+ ret = 1;
242
+ #endif
243
+
244
+ if (ret == 0)
245
+ printf("Successfully tested %d inputs\n", numInputs);
246
+
247
+ return(ret);
248
+ }
249
+
local-test-libxml2-full-01/afc-libxml2/fuzz/uri.c ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * uri.c: a libFuzzer target to test the URI module.
3
+ *
4
+ * See Copyright for the status of this software.
5
+ */
6
+
7
+ #include <libxml/uri.h>
8
+ #include "fuzz.h"
9
+
10
+ int
11
+ LLVMFuzzerInitialize(int *argc ATTRIBUTE_UNUSED,
12
+ char ***argv ATTRIBUTE_UNUSED) {
13
+ xmlFuzzMemSetup();
14
+
15
+ return 0;
16
+ }
17
+
18
+ int
19
+ LLVMFuzzerTestOneInput(const char *data, size_t size) {
20
+ xmlURIPtr uri;
21
+ size_t failurePos;
22
+ const char *str1, *str2;
23
+ char *copy;
24
+ xmlChar *strRes;
25
+ int intRes;
26
+
27
+ if (size > 10000)
28
+ return(0);
29
+
30
+ xmlFuzzDataInit(data, size);
31
+ failurePos = xmlFuzzReadInt(4) % (size * 8 + 100);
32
+ str1 = xmlFuzzReadString(NULL);
33
+ str2 = xmlFuzzReadString(NULL);
34
+
35
+ xmlFuzzInjectFailure(failurePos);
36
+
37
+ xmlFuzzResetFailure();
38
+ intRes = xmlParseURISafe(str1, &uri);
39
+ xmlFuzzCheckFailureReport("xmlParseURISafe", intRes == -1, 0);
40
+
41
+ if (uri != NULL) {
42
+ xmlFuzzResetFailure();
43
+ strRes = xmlSaveUri(uri);
44
+ xmlFuzzCheckFailureReport("xmlSaveURI", strRes == NULL, 0);
45
+ xmlFree(strRes);
46
+ xmlFreeURI(uri);
47
+ }
48
+
49
+ xmlFreeURI(xmlParseURI(str1));
50
+
51
+ uri = xmlParseURIRaw(str1, 1);
52
+ xmlFree(xmlSaveUri(uri));
53
+ xmlFreeURI(uri);
54
+
55
+ xmlFuzzResetFailure();
56
+ strRes = BAD_CAST xmlURIUnescapeString(str1, -1, NULL);
57
+ xmlFuzzCheckFailureReport("xmlURIUnescapeString",
58
+ str1 != NULL && strRes == NULL, 0);
59
+ xmlFree(strRes);
60
+
61
+ xmlFree(xmlURIEscape(BAD_CAST str1));
62
+
63
+ xmlFuzzResetFailure();
64
+ strRes = xmlCanonicPath(BAD_CAST str1);
65
+ xmlFuzzCheckFailureReport("xmlCanonicPath",
66
+ str1 != NULL && strRes == NULL, 0);
67
+ xmlFree(strRes);
68
+
69
+ xmlFuzzResetFailure();
70
+ strRes = xmlPathToURI(BAD_CAST str1);
71
+ xmlFuzzCheckFailureReport("xmlPathToURI",
72
+ str1 != NULL && strRes == NULL, 0);
73
+ xmlFree(strRes);
74
+
75
+ xmlFuzzResetFailure();
76
+ intRes = xmlBuildURISafe(BAD_CAST str2, BAD_CAST str1, &strRes);
77
+ xmlFuzzCheckFailureReport("xmlBuildURISafe", intRes == -1, 0);
78
+ xmlFree(strRes);
79
+
80
+ xmlFree(xmlBuildURI(BAD_CAST str2, BAD_CAST str1));
81
+
82
+ xmlFuzzResetFailure();
83
+ intRes = xmlBuildRelativeURISafe(BAD_CAST str2, BAD_CAST str1, &strRes);
84
+ xmlFuzzCheckFailureReport("xmlBuildRelativeURISafe", intRes == -1, 0);
85
+ xmlFree(strRes);
86
+
87
+ xmlFree(xmlBuildRelativeURI(BAD_CAST str2, BAD_CAST str1));
88
+
89
+ xmlFuzzResetFailure();
90
+ strRes = xmlURIEscapeStr(BAD_CAST str1, BAD_CAST str2);
91
+ xmlFuzzCheckFailureReport("xmlURIEscapeStr",
92
+ str1 != NULL && strRes == NULL, 0);
93
+ xmlFree(strRes);
94
+
95
+ copy = (char *) xmlCharStrdup(str1);
96
+ xmlNormalizeURIPath(copy);
97
+ xmlFree(copy);
98
+
99
+ xmlFuzzInjectFailure(0);
100
+ xmlFuzzDataCleanup();
101
+
102
+ return 0;
103
+ }
104
+
local-test-libxml2-full-01/afc-libxml2/fuzz/uri.options ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ [libfuzzer]
2
+ timeout_exitcode=0
local-test-libxml2-full-01/afc-libxml2/fuzz/valid.c ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * valid.c: a libFuzzer target to test DTD validation.
3
+ *
4
+ * See Copyright for the status of this software.
5
+ */
6
+
7
+ #include <libxml/catalog.h>
8
+ #include <libxml/parser.h>
9
+ #include <libxml/tree.h>
10
+ #include <libxml/xmlerror.h>
11
+ #include "fuzz.h"
12
+
13
+ int
14
+ LLVMFuzzerInitialize(int *argc ATTRIBUTE_UNUSED,
15
+ char ***argv ATTRIBUTE_UNUSED) {
16
+ xmlFuzzMemSetup();
17
+ xmlInitParser();
18
+ #ifdef LIBXML_CATALOG_ENABLED
19
+ xmlInitializeCatalog();
20
+ xmlCatalogSetDefaults(XML_CATA_ALLOW_NONE);
21
+ #endif
22
+
23
+ return 0;
24
+ }
25
+
26
+ int
27
+ LLVMFuzzerTestOneInput(const char *data, size_t size) {
28
+ xmlParserCtxtPtr ctxt;
29
+ xmlDocPtr doc;
30
+ const char *docBuffer, *docUrl;
31
+ size_t failurePos, docSize;
32
+ int opts;
33
+
34
+ xmlFuzzDataInit(data, size);
35
+ opts = (int) xmlFuzzReadInt(4);
36
+ opts &= ~XML_PARSE_XINCLUDE;
37
+ opts |= XML_PARSE_DTDVALID;
38
+ failurePos = xmlFuzzReadInt(4) % (size + 100);
39
+
40
+ xmlFuzzReadEntities();
41
+ docBuffer = xmlFuzzMainEntity(&docSize);
42
+ docUrl = xmlFuzzMainUrl();
43
+ if (docBuffer == NULL)
44
+ goto exit;
45
+
46
+ /* Pull parser */
47
+
48
+ xmlFuzzInjectFailure(failurePos);
49
+ ctxt = xmlNewParserCtxt();
50
+ if (ctxt != NULL) {
51
+ xmlCtxtSetErrorHandler(ctxt, xmlFuzzSErrorFunc, NULL);
52
+ xmlCtxtSetResourceLoader(ctxt, xmlFuzzResourceLoader, NULL);
53
+ doc = xmlCtxtReadMemory(ctxt, docBuffer, docSize, docUrl, NULL, opts);
54
+ xmlFuzzCheckFailureReport("xmlCtxtReadMemory",
55
+ ctxt->errNo == XML_ERR_NO_MEMORY,
56
+ ctxt->errNo == XML_IO_EIO);
57
+ xmlFreeDoc(doc);
58
+ xmlFreeParserCtxt(ctxt);
59
+ }
60
+
61
+ /* Post validation */
62
+
63
+ xmlFuzzInjectFailure(failurePos);
64
+ ctxt = xmlNewParserCtxt();
65
+ if (ctxt != NULL) {
66
+ xmlCtxtSetErrorHandler(ctxt, xmlFuzzSErrorFunc, NULL);
67
+ xmlCtxtSetResourceLoader(ctxt, xmlFuzzResourceLoader, NULL);
68
+ doc = xmlCtxtReadMemory(ctxt, docBuffer, docSize, docUrl, NULL,
69
+ opts & ~XML_PARSE_DTDVALID);
70
+ xmlFuzzCheckFailureReport("xmlCtxtReadMemory",
71
+ doc == NULL && ctxt->errNo == XML_ERR_NO_MEMORY,
72
+ doc == NULL && ctxt->errNo == XML_IO_EIO);
73
+ if (doc != NULL) {
74
+ int valid = xmlCtxtValidateDocument(ctxt, doc);
75
+
76
+ xmlFuzzCheckFailureReport("xmlCtxtValidateDocument",
77
+ !valid && ctxt->errNo == XML_ERR_NO_MEMORY,
78
+ !valid && ctxt->errNo == XML_IO_EIO);
79
+ }
80
+ xmlFreeDoc(doc);
81
+ xmlFreeParserCtxt(ctxt);
82
+ }
83
+
84
+ /* Push parser */
85
+
86
+ #ifdef LIBXML_PUSH_ENABLED
87
+ {
88
+ static const size_t maxChunkSize = 128;
89
+ size_t consumed, chunkSize;
90
+
91
+ xmlFuzzInjectFailure(failurePos);
92
+ /*
93
+ * FIXME: xmlCreatePushParserCtxt can still report OOM errors
94
+ * to stderr.
95
+ */
96
+ xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
97
+ ctxt = xmlCreatePushParserCtxt(NULL, NULL, NULL, 0, docUrl);
98
+ xmlSetGenericErrorFunc(NULL, NULL);
99
+ if (ctxt != NULL) {
100
+ xmlCtxtSetErrorHandler(ctxt, xmlFuzzSErrorFunc, NULL);
101
+ xmlCtxtSetResourceLoader(ctxt, xmlFuzzResourceLoader, NULL);
102
+ xmlCtxtUseOptions(ctxt, opts);
103
+
104
+ for (consumed = 0; consumed < docSize; consumed += chunkSize) {
105
+ chunkSize = docSize - consumed;
106
+ if (chunkSize > maxChunkSize)
107
+ chunkSize = maxChunkSize;
108
+ xmlParseChunk(ctxt, docBuffer + consumed, chunkSize, 0);
109
+ }
110
+
111
+ xmlParseChunk(ctxt, NULL, 0, 1);
112
+ xmlFuzzCheckFailureReport("xmlParseChunk",
113
+ ctxt->errNo == XML_ERR_NO_MEMORY,
114
+ ctxt->errNo == XML_IO_EIO);
115
+ xmlFreeDoc(ctxt->myDoc);
116
+ xmlFreeParserCtxt(ctxt);
117
+ }
118
+ }
119
+ #endif
120
+
121
+ exit:
122
+ xmlFuzzInjectFailure(0);
123
+ xmlFuzzDataCleanup();
124
+ xmlResetLastError();
125
+ return(0);
126
+ }
127
+
local-test-libxml2-full-01/afc-libxml2/fuzz/valid.options ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ [libfuzzer]
2
+ dict = xml.dict
3
+ timeout_exitcode=0
local-test-libxml2-full-01/afc-libxml2/fuzz/xinclude.c ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * xinclude.c: a libFuzzer target to test the XInclude engine.
3
+ *
4
+ * See Copyright for the status of this software.
5
+ */
6
+
7
+ #include <libxml/catalog.h>
8
+ #include <libxml/parser.h>
9
+ #include <libxml/tree.h>
10
+ #include <libxml/xmlerror.h>
11
+ #include <libxml/xinclude.h>
12
+ #include "fuzz.h"
13
+
14
+ int
15
+ LLVMFuzzerInitialize(int *argc ATTRIBUTE_UNUSED,
16
+ char ***argv ATTRIBUTE_UNUSED) {
17
+ xmlFuzzMemSetup();
18
+ xmlInitParser();
19
+ #ifdef LIBXML_CATALOG_ENABLED
20
+ xmlInitializeCatalog();
21
+ xmlCatalogSetDefaults(XML_CATA_ALLOW_NONE);
22
+ #endif
23
+ xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
24
+
25
+ return 0;
26
+ }
27
+
28
+ int
29
+ LLVMFuzzerTestOneInput(const char *data, size_t size) {
30
+ xmlParserCtxtPtr ctxt;
31
+ xmlDocPtr doc;
32
+ const char *docBuffer, *docUrl;
33
+ size_t failurePos, docSize;
34
+ int opts;
35
+
36
+ xmlFuzzDataInit(data, size);
37
+ opts = (int) xmlFuzzReadInt(4);
38
+ opts |= XML_PARSE_XINCLUDE;
39
+ failurePos = xmlFuzzReadInt(4) % (size + 100);
40
+
41
+ xmlFuzzReadEntities();
42
+ docBuffer = xmlFuzzMainEntity(&docSize);
43
+ docUrl = xmlFuzzMainUrl();
44
+ if (docBuffer == NULL)
45
+ goto exit;
46
+
47
+ /* Pull parser */
48
+
49
+ xmlFuzzInjectFailure(failurePos);
50
+ ctxt = xmlNewParserCtxt();
51
+ if (ctxt != NULL) {
52
+ xmlXIncludeCtxtPtr xinc;
53
+ xmlDocPtr copy;
54
+
55
+ xmlCtxtSetResourceLoader(ctxt, xmlFuzzResourceLoader, NULL);
56
+
57
+ doc = xmlCtxtReadMemory(ctxt, docBuffer, docSize, docUrl, NULL, opts);
58
+ xmlFuzzCheckFailureReport("xmlCtxtReadMemory",
59
+ doc == NULL && ctxt->errNo == XML_ERR_NO_MEMORY,
60
+ doc == NULL && ctxt->errNo == XML_IO_EIO);
61
+
62
+ xinc = xmlXIncludeNewContext(doc);
63
+ xmlXIncludeSetResourceLoader(xinc, xmlFuzzResourceLoader, NULL);
64
+ xmlXIncludeSetFlags(xinc, opts);
65
+ xmlXIncludeProcessNode(xinc, (xmlNodePtr) doc);
66
+ if (doc != NULL) {
67
+ xmlFuzzCheckFailureReport("xmlXIncludeProcessNode",
68
+ xinc == NULL ||
69
+ xmlXIncludeGetLastError(xinc) == XML_ERR_NO_MEMORY,
70
+ xinc != NULL &&
71
+ xmlXIncludeGetLastError(xinc) == XML_IO_EIO);
72
+ }
73
+ xmlXIncludeFreeContext(xinc);
74
+
75
+ xmlFuzzResetFailure();
76
+ copy = xmlCopyDoc(doc, 1);
77
+ if (doc != NULL)
78
+ xmlFuzzCheckFailureReport("xmlCopyNode", copy == NULL, 0);
79
+ xmlFreeDoc(copy);
80
+
81
+ xmlFreeDoc(doc);
82
+ xmlFreeParserCtxt(ctxt);
83
+ }
84
+
85
+ exit:
86
+ xmlFuzzInjectFailure(0);
87
+ xmlFuzzDataCleanup();
88
+ xmlResetLastError();
89
+ return(0);
90
+ }
91
+
local-test-libxml2-full-01/afc-libxml2/fuzz/xinclude.options ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ [libfuzzer]
2
+ dict = xml.dict
3
+ timeout_exitcode=0
local-test-libxml2-full-01/afc-libxml2/fuzz/xml.c ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * xml.c: a libFuzzer target to test several XML parser interfaces.
3
+ *
4
+ * See Copyright for the status of this software.
5
+ */
6
+
7
+ #include <libxml/catalog.h>
8
+ #include <libxml/parser.h>
9
+ #include <libxml/tree.h>
10
+ #include <libxml/xmlerror.h>
11
+ #include <libxml/xmlsave.h>
12
+ #include "fuzz.h"
13
+
14
+ int
15
+ LLVMFuzzerInitialize(int *argc ATTRIBUTE_UNUSED,
16
+ char ***argv ATTRIBUTE_UNUSED) {
17
+ xmlFuzzMemSetup();
18
+ xmlInitParser();
19
+ #ifdef LIBXML_CATALOG_ENABLED
20
+ xmlInitializeCatalog();
21
+ xmlCatalogSetDefaults(XML_CATA_ALLOW_NONE);
22
+ #endif
23
+
24
+ return 0;
25
+ }
26
+
27
+ int
28
+ LLVMFuzzerTestOneInput(const char *data, size_t size) {
29
+ xmlParserCtxtPtr ctxt;
30
+ xmlDocPtr doc;
31
+ const char *docBuffer, *docUrl;
32
+ size_t failurePos, docSize;
33
+ int opts;
34
+ #ifdef LIBXML_OUTPUT_ENABLED
35
+ const char *saveEncoding;
36
+ int saveOpts;
37
+ #endif
38
+
39
+ xmlFuzzDataInit(data, size);
40
+ opts = (int) xmlFuzzReadInt(4);
41
+ /*
42
+ * Disable options that are known to cause timeouts
43
+ */
44
+ opts &= ~XML_PARSE_XINCLUDE &
45
+ ~XML_PARSE_DTDVALID &
46
+ ~XML_PARSE_SAX1;
47
+ failurePos = xmlFuzzReadInt(4) % (size + 100);
48
+
49
+ #ifdef LIBXML_OUTPUT_ENABLED
50
+ /* TODO: Take from fuzz data */
51
+ saveOpts = 0;
52
+ saveEncoding = NULL;
53
+ #endif
54
+
55
+ xmlFuzzReadEntities();
56
+ docBuffer = xmlFuzzMainEntity(&docSize);
57
+ docUrl = xmlFuzzMainUrl();
58
+ if (docBuffer == NULL)
59
+ goto exit;
60
+
61
+ /* Pull parser */
62
+
63
+ xmlFuzzInjectFailure(failurePos);
64
+ ctxt = xmlNewParserCtxt();
65
+ if (ctxt != NULL) {
66
+ xmlCtxtSetErrorHandler(ctxt, xmlFuzzSErrorFunc, NULL);
67
+ xmlCtxtSetResourceLoader(ctxt, xmlFuzzResourceLoader, NULL);
68
+ doc = xmlCtxtReadMemory(ctxt, docBuffer, docSize, docUrl, NULL, opts);
69
+ xmlFuzzCheckFailureReport("xmlCtxtReadMemory",
70
+ doc == NULL && ctxt->errNo == XML_ERR_NO_MEMORY,
71
+ doc == NULL && ctxt->errNo == XML_IO_EIO);
72
+
73
+ if (doc != NULL) {
74
+ #ifdef LIBXML_OUTPUT_ENABLED
75
+ xmlSaveCtxtPtr save;
76
+
77
+ /* Also test the serializer. */
78
+ save = xmlSaveToIO(xmlFuzzOutputWrite, xmlFuzzOutputClose, NULL,
79
+ saveEncoding, saveOpts);
80
+
81
+ if (save != NULL) {
82
+ int errNo;
83
+
84
+ xmlSaveDoc(save, doc);
85
+ errNo = xmlSaveFinish(save);
86
+ xmlFuzzCheckFailureReport("xmlSaveDoc",
87
+ errNo == XML_ERR_NO_MEMORY,
88
+ errNo == XML_IO_EIO);
89
+ }
90
+ #endif
91
+ xmlFreeDoc(doc);
92
+ }
93
+
94
+ xmlFreeParserCtxt(ctxt);
95
+ }
96
+
97
+ /* Push parser */
98
+
99
+ #ifdef LIBXML_PUSH_ENABLED
100
+ {
101
+ static const size_t maxChunkSize = 128;
102
+ size_t consumed, chunkSize;
103
+
104
+ xmlFuzzInjectFailure(failurePos);
105
+ /*
106
+ * FIXME: xmlCreatePushParserCtxt can still report OOM errors
107
+ * to stderr.
108
+ */
109
+ xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
110
+ ctxt = xmlCreatePushParserCtxt(NULL, NULL, NULL, 0, docUrl);
111
+ xmlSetGenericErrorFunc(NULL, NULL);
112
+ if (ctxt != NULL) {
113
+ xmlCtxtSetErrorHandler(ctxt, xmlFuzzSErrorFunc, NULL);
114
+ xmlCtxtSetResourceLoader(ctxt, xmlFuzzResourceLoader, NULL);
115
+ xmlCtxtUseOptions(ctxt, opts);
116
+
117
+ for (consumed = 0; consumed < docSize; consumed += chunkSize) {
118
+ chunkSize = docSize - consumed;
119
+ if (chunkSize > maxChunkSize)
120
+ chunkSize = maxChunkSize;
121
+ xmlParseChunk(ctxt, docBuffer + consumed, chunkSize, 0);
122
+ }
123
+
124
+ xmlParseChunk(ctxt, NULL, 0, 1);
125
+ xmlFuzzCheckFailureReport("xmlParseChunk",
126
+ ctxt->errNo == XML_ERR_NO_MEMORY,
127
+ ctxt->errNo == XML_IO_EIO);
128
+ xmlFreeDoc(ctxt->myDoc);
129
+ xmlFreeParserCtxt(ctxt);
130
+ }
131
+ }
132
+ #endif
133
+
134
+ exit:
135
+ xmlFuzzInjectFailure(0);
136
+ xmlFuzzDataCleanup();
137
+ xmlResetLastError();
138
+ return(0);
139
+ }
140
+
local-test-libxml2-full-01/afc-libxml2/fuzz/xml.dict ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ xml_decl="<?xml version='1.0'?>"
2
+ xml_decl_standalone="<?xml version='1.0' standalone='1'?>"
3
+ xml_decl_latin1="<?xml version='1.0' encoding='ISO-8859-1'?>"
4
+
5
+ elem_start_end="<a></a>"
6
+ elem_empty="<a/>"
7
+ elem_ns_start_end="<a:a xmlns:a='a'></a:a>"
8
+ elem_ns_empty="<a:a xmlns:a='a'/>"
9
+
10
+ attr=" a='a'"
11
+
12
+ ns_decl=" xmlns:a='a'"
13
+ ns_default=" xmlns='a'"
14
+ ns_prefix="a:"
15
+
16
+ cdata_section="<![CDATA[ ]]>"
17
+
18
+ comment="<!-- -->"
19
+
20
+ pi="<?a?>"
21
+
22
+ doctype="<!DOCTYPE a []>"
23
+ doctype_system="<!DOCTYPE a SYSTEM 'a' []>"
24
+ doctype_system="<!DOCTYPE a PUBLIC 'a' 'a' []>"
25
+
26
+ elem_decl_any="<!ELEMENT a ANY>"
27
+ elem_decl_empty="<!ELEMENT a EMPTY>"
28
+ elem_decl_children="<!ELEMENT a (a)>"
29
+ elem_decl_mixed="<!ELEMENT a (#PCDATA|a)>"
30
+ elem_children_choice="|a"
31
+ elem_children_seq=",a"
32
+ elem_children_sub_choice="|(a)"
33
+ elem_children_sub_seq=",(a)"
34
+ elem_quant_any="*"
35
+ elem_quant_opt="?"
36
+ elem_quant_some="+"
37
+
38
+ attr_decl_cdata_req="<!ATTLIST a a CDATA #REQUIRED>"
39
+ attr_decl_cdata_imp="<!ATTLIST a a CDATA #IMPLIED>"
40
+ attr_decl_cdata_def="<!ATTLIST a a CDATA 'a'>"
41
+ attr_decl_cdata_fix="<!ATTLIST a a CDATA #FIXED 'a'>"
42
+ attr_decl_id_imp="<!ATTLIST a a ID #IMPLIED>"
43
+ attr_decl_id_req="<!ATTLIST a a ID #REQUIRED>"
44
+ attr_decl_id_def="<!ATTLIST a a ID 'a'>"
45
+ attr_decl_id_fix="<!ATTLIST a a ID #FIXED 'a'>"
46
+ attr_decl_idref_imp="<!ATTLIST a a IDREF #IMPLIED>"
47
+ attr_decl_idref_req="<!ATTLIST a a IDREF #REQUIRED>"
48
+ attr_decl_idref_def="<!ATTLIST a a IDREF 'a'>"
49
+ attr_decl_idref_fix="<!ATTLIST a a IDREF #FIXED 'a'>"
50
+ attr_decl_idrefs_imp="<!ATTLIST a a IDREFS #IMPLIED>"
51
+ attr_decl_idrefs_req="<!ATTLIST a a IDREFS #REQUIRED>"
52
+ attr_decl_idrefs_def="<!ATTLIST a a IDREFS 'a'>"
53
+ attr_decl_idrefs_fix="<!ATTLIST a a IDREFS #FIXED 'a'>"
54
+ attr_decl_entity_imp="<!ATTLIST a a ENTITY #IMPLIED>"
55
+ attr_decl_entity_req="<!ATTLIST a a ENTITY #REQUIRED>"
56
+ attr_decl_entity_def="<!ATTLIST a a ENTITY 'a'>"
57
+ attr_decl_entity_fix="<!ATTLIST a a ENTITY #FIXED 'a'>"
58
+ attr_decl_entities_imp="<!ATTLIST a a ENTITIES #IMPLIED>"
59
+ attr_decl_entities_req="<!ATTLIST a a ENTITIES #REQUIRED>"
60
+ attr_decl_entities_def="<!ATTLIST a a ENTITIES 'a'>"
61
+ attr_decl_entities_fix="<!ATTLIST a a ENTITIES #FIXED 'a'>"
62
+ attr_decl_nmtoken_imp="<!ATTLIST a a NMTOKEN #IMPLIED>"
63
+ attr_decl_nmtoken_req="<!ATTLIST a a NMTOKEN #REQUIRED>"
64
+ attr_decl_nmtoken_def="<!ATTLIST a a NMTOKEN 'a'>"
65
+ attr_decl_nmtoken_fix="<!ATTLIST a a NMTOKEN #FIXED 'a'>"
66
+ attr_decl_nmtokens_imp="<!ATTLIST a a NMTOKENS #IMPLIED>"
67
+ attr_decl_nmtokens_req="<!ATTLIST a a NMTOKENS #REQUIRED>"
68
+ attr_decl_nmtokens_def="<!ATTLIST a a NMTOKENS 'a'>"
69
+ attr_decl_nmtokens_fix="<!ATTLIST a a NMTOKENS #FIXED 'a'>"
70
+ attr_decl_enum_imp="<!ATTLIST a a (a) #IMPLIED>"
71
+ attr_decl_enum_req="<!ATTLIST a a (a) #REQUIRED>"
72
+ attr_decl_enum_def="<!ATTLIST a a (a) 'a'>"
73
+ attr_decl_enum_fix="<!ATTLIST a a (a) #FIXED 'a'>"
74
+ attr_decl_notation_imp="<!ATTLIST a a NOTATION (a) #IMPLIED>"
75
+ attr_decl_notation_req="<!ATTLIST a a NOTATION (a) #REQUIRED>"
76
+ attr_decl_notation_def="<!ATTLIST a a NOTATION (a) 'a'>"
77
+ attr_decl_notation_fix="<!ATTLIST a a NOTATION (a) #FIXED 'a'>"
78
+
79
+ include_sect="<![INCLUDE[ ]]>"
80
+ ignore_sect="<![IGNORE[ ]]>"
81
+
82
+ ge_decl="<!ENTITY a 'a'>"
83
+ ge_decl_system="<!ENTITY a SYSTEM 'a'>"
84
+ ge_decl_system_ndata="<!ENTITY a SYSTEM 'a' NDATA a>"
85
+ ge_decl_public="<!ENTITY a PUBLIC 'a' 'a'>"
86
+ ge_decl_public_ndata="<!ENTITY a PUBLIC 'a' 'a' NDATA a>"
87
+
88
+ pe_decl="<!ENTITY % a 'a'>"
89
+ pe_decl_system="<!ENTITY % a SYSTEM 'a'>"
90
+ pe_decl_public="<!ENTITY % a PUBLIC 'a' 'a'>"
91
+
92
+ char_ref_dec="&#60;"
93
+ char_ref_hex="&#x3c;"
94
+ char_ref_quoted="&#38;#60;"
95
+
96
+ ge_ref_lt="&lt;"
97
+ ge_ref_gt="&gt;"
98
+ ge_ref_amp="&amp;"
99
+ ge_ref_apos="&apos;"
100
+ ge_ref_quot="&quot;"
101
+ ge_ref="&a;"
102
+ ge_ref_quoted="&#38;a;"
103
+
104
+ pe_ref="%a;"
105
+ pe_ref_quoted="&#37;a;"
106
+
107
+ notation_decl_public="<!NOTATION a PUBLIC 'a'>"
108
+ notation_decl_system="<!NOTATION a SYSTEM 'a'>"
109
+
110
+ cs_utf8="UTF-8"
111
+ cs_utf16="UTF-16"
112
+ cs_utf16le="UTF-16LE"
113
+ cs_utf16be="UTF-16BE"
114
+ cs_ucs2="UCS-2"
115
+ cs_ucs4="UCS-4"
116
+ cs_latin1="ISO-8859-1"
117
+ cs_ascii="ASCII"
118
+ cs_ebcdic="EBCDIC"
119
+ cs_iso2022jp="ISO-2022-JP"
120
+ cs_shift_jis="SHIFT_JIS"
121
+ cs_euc_jp="EUC-JP"
local-test-libxml2-full-01/afc-libxml2/fuzz/xml.options ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ [libfuzzer]
2
+ timeout_exitcode=0
local-test-libxml2-full-01/afc-libxml2/fuzz/xpath.c ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * xpath.c: a libFuzzer target to test XPath and XPointer expressions.
3
+ *
4
+ * See Copyright for the status of this software.
5
+ */
6
+
7
+ #include <libxml/catalog.h>
8
+ #include <libxml/parser.h>
9
+ #include <libxml/xpointer.h>
10
+ #include "fuzz.h"
11
+
12
+ int
13
+ LLVMFuzzerInitialize(int *argc ATTRIBUTE_UNUSED,
14
+ char ***argv ATTRIBUTE_UNUSED) {
15
+ xmlFuzzMemSetup();
16
+ xmlInitParser();
17
+ #ifdef LIBXML_CATALOG_ENABLED
18
+ xmlInitializeCatalog();
19
+ xmlCatalogSetDefaults(XML_CATA_ALLOW_NONE);
20
+ #endif
21
+ xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
22
+
23
+ return 0;
24
+ }
25
+
26
+ int
27
+ LLVMFuzzerTestOneInput(const char *data, size_t size) {
28
+ xmlDocPtr doc;
29
+ const char *expr, *xml;
30
+ size_t failurePos, exprSize, xmlSize;
31
+
32
+ if (size > 10000)
33
+ return(0);
34
+
35
+ xmlFuzzDataInit(data, size);
36
+
37
+ failurePos = xmlFuzzReadInt(4) % (size + 100);
38
+ expr = xmlFuzzReadString(&exprSize);
39
+ xml = xmlFuzzReadString(&xmlSize);
40
+
41
+ /* Recovery mode allows more input to be fuzzed. */
42
+ doc = xmlReadMemory(xml, xmlSize, NULL, NULL, XML_PARSE_RECOVER);
43
+ if (doc != NULL) {
44
+ xmlXPathContextPtr xpctxt;
45
+
46
+ xmlFuzzInjectFailure(failurePos);
47
+
48
+ xpctxt = xmlXPathNewContext(doc);
49
+ if (xpctxt != NULL) {
50
+ int res;
51
+
52
+ /* Operation limit to avoid timeout */
53
+ xpctxt->opLimit = 500000;
54
+
55
+ res = xmlXPathContextSetCache(xpctxt, 1, 4, 0);
56
+ xmlFuzzCheckFailureReport("xmlXPathContextSetCache", res == -1, 0);
57
+
58
+ xmlFuzzResetFailure();
59
+ xmlXPathFreeObject(xmlXPtrEval(BAD_CAST expr, xpctxt));
60
+ xmlFuzzCheckFailureReport("xmlXPtrEval",
61
+ xpctxt->lastError.code == XML_ERR_NO_MEMORY, 0);
62
+ xmlXPathFreeContext(xpctxt);
63
+ }
64
+
65
+ xmlFuzzInjectFailure(0);
66
+ xmlFreeDoc(doc);
67
+ }
68
+
69
+ xmlFuzzDataCleanup();
70
+ xmlResetLastError();
71
+
72
+ return(0);
73
+ }
74
+
local-test-libxml2-full-01/afc-libxml2/fuzz/xpath.dict ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # XML
2
+
3
+ elem_a="<a></a>"
4
+ elem_b="<b></b>"
5
+ elem_c="<c></c>"
6
+ elem_d="<d></d>"
7
+ elem_empty="<a/>"
8
+ elem_ns_a="<a:a xmlns:a='a'></a:a>"
9
+ elem_ns_b="<b:b xmlns:b='b'></b:b>"
10
+
11
+ attr_a=" a='a'"
12
+ attr_b=" b='b'"
13
+
14
+ ns_decl=" xmlns:a='a'"
15
+ ns_default=" xmlns='a'"
16
+ ns_prefix_a="a:"
17
+ ns_prefix_b="b:"
18
+
19
+ cdata_section="<![CDATA[ ]]>"
20
+
21
+ comment="<!-- -->"
22
+
23
+ pi="<?a?>"
24
+
25
+ # XPath
26
+
27
+ axis_ancestor="ancestor::"
28
+ axis_ancestor_or_self="ancestor-or-self::"
29
+ axis_attribute="attribute::"
30
+ axis_attribute_abbrev="@"
31
+ axis_child="child::"
32
+ axis_descendant="descendant::"
33
+ axis_descendant_or_self="descendant-or-self::"
34
+ axis_following="following::"
35
+ axis_following_sibling="following-sibling::"
36
+ axis_namespace="namespace::"
37
+ axis_parent="parent::"
38
+ axis_preceding="preceding::"
39
+ axis_preceding_siblings="preceding-sibling::"
40
+ axis_self="self::"
41
+
42
+ node_test_ns="a:"
43
+
44
+ val_num="=(1.0)"
45
+ val_str_sq="=('a')"
46
+ val_str_dq="=(\"a\")"
47
+ val_node_set="=(*)"
48
+ val_elem="=(b)"
49
+
50
+ step_root="/"
51
+ step_descendant="//"
52
+ step_any="//*"
53
+ step_any_l="*//"
54
+ step_elem="//b"
55
+ step_ns_elem="//a:a"
56
+ step_comment="//comment()"
57
+ step_node="//node()"
58
+ step_node_l="node()//"
59
+ step_pi="//processing-instruction()"
60
+ step_text="//text()"
61
+ step_parent="../"
62
+
63
+ op_plus="+1"
64
+ op_minus=" - 1"
65
+ op_neg="-"
66
+ op_mul="*1"
67
+ op_div=" div 1"
68
+ op_mod=" mod 1"
69
+ op_and=" and 1"
70
+ op_or=" or 1"
71
+ op_ne="!=1"
72
+ op_lt="<1"
73
+ op_gt=">1"
74
+ op_le="<=1"
75
+ op_ge=">=1"
76
+ op_predicate_num="[1]"
77
+ op_predicate_last="[last()]"
78
+ op_predicate_str="['a']"
79
+ op_predicate="[1=1]"
80
+ op_arg_num=",1"
81
+ op_arg_str=",'a'"
82
+ op_arg_node=",*"
83
+ op_union="|//b"
84
+
85
+ var_num="=$f"
86
+ var_bool="=$b"
87
+ var_str="=$s"
88
+ var_node_set="=$n"
89
+
90
+ # Unicode
91
+
92
+ utf8_2="\xC3\x84"
93
+ utf8_3="\xE2\x80\x9C"
94
+ utf8_4="\xF0\x9F\x98\x80"
local-test-libxml2-full-01/afc-libxml2/fuzz/xpath.options ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ [libfuzzer]
2
+ timeout_exitcode=0
local-test-libxml2-full-01/afc-libxml2/result/dav1 ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <D:multistatus xmlns:D="http://www.ietf.org/standards/dav/" xmlns:R="http://www.foo.bar/boxschema">
3
+ <D:response>
4
+ <D:prop>
5
+ <R:bigbox>
6
+ <R:BoxType>Box type A</R:BoxType>
7
+ </R:bigbox>
8
+ <R:author>
9
+ <R:Name>J.J. Dingleheimerschmidt</R:Name>
10
+ </R:author>
11
+ </D:prop>
12
+ <D:status>HTTP/1.1 200 OK</D:status>
13
+ </D:response>
14
+ <D:response>
15
+ <D:prop>
16
+ <R:DingALing/>
17
+ <R:Random/>
18
+ </D:prop>
19
+ <D:status>HTTP/1.1 403 Forbidden</D:status>
20
+ <D:responsedescription> The user does not have access to the DingALing property.
21
+ </D:responsedescription>
22
+ </D:response>
23
+ <D:responsedescription> There has been an access violation error.
24
+ </D:responsedescription>
25
+ </D:multistatus>
local-test-libxml2-full-01/afc-libxml2/result/ent10.rde ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 0 10 rnode 0 0
2
+ 0 1 rnode 0 0
3
+ 1 14 #text 0 1
4
+
5
+
6
+ 1 1 f 0 0
7
+ 2 3 #text 0 1
8
+ hello world
9
+
10
+ 1 15 f 0 0
11
+ 1 14 #text 0 1
12
+
13
+
14
+ 0 15 rnode 0 0
local-test-libxml2-full-01/afc-libxml2/result/eve.xml.sax ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ SAX.setDocumentLocator()
2
+ SAX.startDocument()
3
+ SAX.internalSubset(spec, -//testspec//, dtds/eve.dtd)
4
+ SAX.entityDecl(iso6.doc.date, 1, (null), (null), 29-May-1999)
5
+ SAX.getEntity(iso6.doc.date)
6
+ SAX.externalSubset(spec, -//testspec//, dtds/eve.dtd)
7
+ SAX.startElement(spec)
8
+ SAX.characters(
9
+ , 1)
10
+ SAX.endElement(spec)
11
+ SAX.endDocument()
local-test-libxml2-full-01/afc-libxml2/result/pi2.xml.rde ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ 0 7 document-start 0 1 doc
2
+ 0 1 doc 0 0
3
+ 1 14 #text 0 1
4
+
5
+ 1 1 empty 1 0
6
+ 1 14 #text 0 1
7
+
8
+ 0 15 doc 0 0
9
+ 0 7 document-end 0 1 doc
local-test-libxml2-full-01/afc-libxml2/result/svg3.rde ADDED
@@ -0,0 +1,2164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 0 1 svg 0 0
2
+ 1 14 #text 0 1
3
+
4
+ 1 1 g 0 0
5
+ 2 14 #text 0 1
6
+
7
+ 2 1 path 1 0
8
+ 2 14 #text 0 1
9
+
10
+ 1 15 g 0 0
11
+ 1 14 #text 0 1
12
+
13
+ 1 1 g 0 0
14
+ 2 14 #text 0 1
15
+
16
+ 2 1 path 1 0
17
+ 2 14 #text 0 1
18
+
19
+ 1 15 g 0 0
20
+ 1 14 #text 0 1
21
+
22
+ 1 1 g 0 0
23
+ 2 14 #text 0 1
24
+
25
+ 2 1 path 1 0
26
+ 2 14 #text 0 1
27
+
28
+ 1 15 g 0 0
29
+ 1 14 #text 0 1
30
+
31
+ 1 1 g 0 0
32
+ 2 14 #text 0 1
33
+
34
+ 2 1 path 1 0
35
+ 2 14 #text 0 1
36
+
37
+ 1 15 g 0 0
38
+ 1 14 #text 0 1
39
+
40
+ 1 1 g 0 0
41
+ 2 14 #text 0 1
42
+
43
+ 2 1 path 1 0
44
+ 2 14 #text 0 1
45
+
46
+ 1 15 g 0 0
47
+ 1 14 #text 0 1
48
+
49
+ 1 1 g 0 0
50
+ 2 14 #text 0 1
51
+
52
+ 2 1 path 1 0
53
+ 2 14 #text 0 1
54
+
55
+ 1 15 g 0 0
56
+ 1 14 #text 0 1
57
+
58
+ 1 1 g 0 0
59
+ 2 14 #text 0 1
60
+
61
+ 2 1 path 1 0
62
+ 2 14 #text 0 1
63
+
64
+ 1 15 g 0 0
65
+ 1 14 #text 0 1
66
+
67
+ 1 1 g 0 0
68
+ 2 14 #text 0 1
69
+
70
+ 2 1 path 1 0
71
+ 2 14 #text 0 1
72
+
73
+ 1 15 g 0 0
74
+ 1 14 #text 0 1
75
+
76
+ 1 1 g 0 0
77
+ 2 14 #text 0 1
78
+
79
+ 2 1 path 1 0
80
+ 2 14 #text 0 1
81
+
82
+ 1 15 g 0 0
83
+ 1 14 #text 0 1
84
+
85
+ 1 1 g 0 0
86
+ 2 14 #text 0 1
87
+
88
+ 2 1 path 1 0
89
+ 2 14 #text 0 1
90
+
91
+ 1 15 g 0 0
92
+ 1 14 #text 0 1
93
+
94
+ 1 1 g 0 0
95
+ 2 14 #text 0 1
96
+
97
+ 2 1 path 1 0
98
+ 2 14 #text 0 1
99
+
100
+ 1 15 g 0 0
101
+ 1 14 #text 0 1
102
+
103
+ 1 1 g 0 0
104
+ 2 14 #text 0 1
105
+
106
+ 2 1 path 1 0
107
+ 2 14 #text 0 1
108
+
109
+ 1 15 g 0 0
110
+ 1 14 #text 0 1
111
+
112
+ 1 1 g 0 0
113
+ 2 14 #text 0 1
114
+
115
+ 2 1 path 1 0
116
+ 2 14 #text 0 1
117
+
118
+ 1 15 g 0 0
119
+ 1 14 #text 0 1
120
+
121
+ 1 1 g 0 0
122
+ 2 14 #text 0 1
123
+
124
+ 2 1 path 1 0
125
+ 2 14 #text 0 1
126
+
127
+ 1 15 g 0 0
128
+ 1 14 #text 0 1
129
+
130
+ 1 1 g 0 0
131
+ 2 14 #text 0 1
132
+
133
+ 2 1 path 1 0
134
+ 2 14 #text 0 1
135
+
136
+ 1 15 g 0 0
137
+ 1 14 #text 0 1
138
+
139
+ 1 1 g 0 0
140
+ 2 14 #text 0 1
141
+
142
+ 2 1 path 1 0
143
+ 2 14 #text 0 1
144
+
145
+ 1 15 g 0 0
146
+ 1 14 #text 0 1
147
+
148
+ 1 1 g 0 0
149
+ 2 14 #text 0 1
150
+
151
+ 2 1 path 1 0
152
+ 2 14 #text 0 1
153
+
154
+ 1 15 g 0 0
155
+ 1 14 #text 0 1
156
+
157
+ 1 1 g 0 0
158
+ 2 14 #text 0 1
159
+
160
+ 2 1 path 1 0
161
+ 2 14 #text 0 1
162
+
163
+ 1 15 g 0 0
164
+ 1 14 #text 0 1
165
+
166
+ 1 1 g 0 0
167
+ 2 14 #text 0 1
168
+
169
+ 2 1 path 1 0
170
+ 2 14 #text 0 1
171
+
172
+ 1 15 g 0 0
173
+ 1 14 #text 0 1
174
+
175
+ 1 1 g 0 0
176
+ 2 14 #text 0 1
177
+
178
+ 2 1 path 1 0
179
+ 2 14 #text 0 1
180
+
181
+ 1 15 g 0 0
182
+ 1 14 #text 0 1
183
+
184
+ 1 1 g 0 0
185
+ 2 14 #text 0 1
186
+
187
+ 2 1 path 1 0
188
+ 2 14 #text 0 1
189
+
190
+ 1 15 g 0 0
191
+ 1 14 #text 0 1
192
+
193
+ 1 1 g 0 0
194
+ 2 14 #text 0 1
195
+
196
+ 2 1 path 1 0
197
+ 2 14 #text 0 1
198
+
199
+ 1 15 g 0 0
200
+ 1 14 #text 0 1
201
+
202
+ 1 1 g 0 0
203
+ 2 14 #text 0 1
204
+
205
+ 2 1 path 1 0
206
+ 2 14 #text 0 1
207
+
208
+ 1 15 g 0 0
209
+ 1 14 #text 0 1
210
+
211
+ 1 1 g 0 0
212
+ 2 14 #text 0 1
213
+
214
+ 2 1 path 1 0
215
+ 2 14 #text 0 1
216
+
217
+ 1 15 g 0 0
218
+ 1 14 #text 0 1
219
+
220
+ 1 1 g 0 0
221
+ 2 14 #text 0 1
222
+
223
+ 2 1 path 1 0
224
+ 2 14 #text 0 1
225
+
226
+ 1 15 g 0 0
227
+ 1 14 #text 0 1
228
+
229
+ 1 1 g 0 0
230
+ 2 14 #text 0 1
231
+
232
+ 2 1 path 1 0
233
+ 2 14 #text 0 1
234
+
235
+ 1 15 g 0 0
236
+ 1 14 #text 0 1
237
+
238
+ 1 1 g 0 0
239
+ 2 14 #text 0 1
240
+
241
+ 2 1 path 1 0
242
+ 2 14 #text 0 1
243
+
244
+ 1 15 g 0 0
245
+ 1 14 #text 0 1
246
+
247
+ 1 1 g 0 0
248
+ 2 14 #text 0 1
249
+
250
+ 2 1 path 1 0
251
+ 2 14 #text 0 1
252
+
253
+ 1 15 g 0 0
254
+ 1 14 #text 0 1
255
+
256
+ 1 1 g 0 0
257
+ 2 14 #text 0 1
258
+
259
+ 2 1 path 1 0
260
+ 2 14 #text 0 1
261
+
262
+ 1 15 g 0 0
263
+ 1 14 #text 0 1
264
+
265
+ 1 1 g 0 0
266
+ 2 14 #text 0 1
267
+
268
+ 2 1 path 1 0
269
+ 2 14 #text 0 1
270
+
271
+ 1 15 g 0 0
272
+ 1 14 #text 0 1
273
+
274
+ 1 1 g 0 0
275
+ 2 14 #text 0 1
276
+
277
+ 2 1 path 1 0
278
+ 2 14 #text 0 1
279
+
280
+ 1 15 g 0 0
281
+ 1 14 #text 0 1
282
+
283
+ 1 1 g 0 0
284
+ 2 14 #text 0 1
285
+
286
+ 2 1 path 1 0
287
+ 2 14 #text 0 1
288
+
289
+ 1 15 g 0 0
290
+ 1 14 #text 0 1
291
+
292
+ 1 1 g 0 0
293
+ 2 14 #text 0 1
294
+
295
+ 2 1 path 1 0
296
+ 2 14 #text 0 1
297
+
298
+ 1 15 g 0 0
299
+ 1 14 #text 0 1
300
+
301
+ 1 1 g 0 0
302
+ 2 14 #text 0 1
303
+
304
+ 2 1 path 1 0
305
+ 2 14 #text 0 1
306
+
307
+ 1 15 g 0 0
308
+ 1 14 #text 0 1
309
+
310
+ 1 1 g 0 0
311
+ 2 14 #text 0 1
312
+
313
+ 2 1 path 1 0
314
+ 2 14 #text 0 1
315
+
316
+ 1 15 g 0 0
317
+ 1 14 #text 0 1
318
+
319
+ 1 1 g 0 0
320
+ 2 14 #text 0 1
321
+
322
+ 2 1 path 1 0
323
+ 2 14 #text 0 1
324
+
325
+ 1 15 g 0 0
326
+ 1 14 #text 0 1
327
+
328
+ 1 1 g 0 0
329
+ 2 14 #text 0 1
330
+
331
+ 2 1 path 1 0
332
+ 2 14 #text 0 1
333
+
334
+ 1 15 g 0 0
335
+ 1 14 #text 0 1
336
+
337
+ 1 1 g 0 0
338
+ 2 14 #text 0 1
339
+
340
+ 2 1 path 1 0
341
+ 2 14 #text 0 1
342
+
343
+ 1 15 g 0 0
344
+ 1 14 #text 0 1
345
+
346
+ 1 1 g 0 0
347
+ 2 14 #text 0 1
348
+
349
+ 2 1 path 1 0
350
+ 2 14 #text 0 1
351
+
352
+ 1 15 g 0 0
353
+ 1 14 #text 0 1
354
+
355
+ 1 1 g 0 0
356
+ 2 14 #text 0 1
357
+
358
+ 2 1 path 1 0
359
+ 2 14 #text 0 1
360
+
361
+ 1 15 g 0 0
362
+ 1 14 #text 0 1
363
+
364
+ 1 1 g 0 0
365
+ 2 14 #text 0 1
366
+
367
+ 2 1 path 1 0
368
+ 2 14 #text 0 1
369
+
370
+ 1 15 g 0 0
371
+ 1 14 #text 0 1
372
+
373
+ 1 1 g 0 0
374
+ 2 14 #text 0 1
375
+
376
+ 2 1 path 1 0
377
+ 2 14 #text 0 1
378
+
379
+ 1 15 g 0 0
380
+ 1 14 #text 0 1
381
+
382
+ 1 1 g 0 0
383
+ 2 14 #text 0 1
384
+
385
+ 2 1 path 1 0
386
+ 2 14 #text 0 1
387
+
388
+ 1 15 g 0 0
389
+ 1 14 #text 0 1
390
+
391
+ 1 1 g 0 0
392
+ 2 14 #text 0 1
393
+
394
+ 2 1 path 1 0
395
+ 2 14 #text 0 1
396
+
397
+ 1 15 g 0 0
398
+ 1 14 #text 0 1
399
+
400
+ 1 1 g 0 0
401
+ 2 14 #text 0 1
402
+
403
+ 2 1 path 1 0
404
+ 2 14 #text 0 1
405
+
406
+ 1 15 g 0 0
407
+ 1 14 #text 0 1
408
+
409
+ 1 1 g 0 0
410
+ 2 14 #text 0 1
411
+
412
+ 2 1 path 1 0
413
+ 2 14 #text 0 1
414
+
415
+ 1 15 g 0 0
416
+ 1 14 #text 0 1
417
+
418
+ 1 1 g 0 0
419
+ 2 14 #text 0 1
420
+
421
+ 2 1 path 1 0
422
+ 2 14 #text 0 1
423
+
424
+ 1 15 g 0 0
425
+ 1 14 #text 0 1
426
+
427
+ 1 1 g 0 0
428
+ 2 14 #text 0 1
429
+
430
+ 2 1 path 1 0
431
+ 2 14 #text 0 1
432
+
433
+ 1 15 g 0 0
434
+ 1 14 #text 0 1
435
+
436
+ 1 1 g 0 0
437
+ 2 14 #text 0 1
438
+
439
+ 2 1 path 1 0
440
+ 2 14 #text 0 1
441
+
442
+ 1 15 g 0 0
443
+ 1 14 #text 0 1
444
+
445
+ 1 1 g 0 0
446
+ 2 14 #text 0 1
447
+
448
+ 2 1 path 1 0
449
+ 2 14 #text 0 1
450
+
451
+ 1 15 g 0 0
452
+ 1 14 #text 0 1
453
+
454
+ 1 1 g 0 0
455
+ 2 14 #text 0 1
456
+
457
+ 2 1 path 1 0
458
+ 2 14 #text 0 1
459
+
460
+ 1 15 g 0 0
461
+ 1 14 #text 0 1
462
+
463
+ 1 1 g 0 0
464
+ 2 14 #text 0 1
465
+
466
+ 2 1 path 1 0
467
+ 2 14 #text 0 1
468
+
469
+ 1 15 g 0 0
470
+ 1 14 #text 0 1
471
+
472
+ 1 1 g 0 0
473
+ 2 14 #text 0 1
474
+
475
+ 2 1 path 1 0
476
+ 2 14 #text 0 1
477
+
478
+ 1 15 g 0 0
479
+ 1 14 #text 0 1
480
+
481
+ 1 1 g 0 0
482
+ 2 14 #text 0 1
483
+
484
+ 2 1 path 1 0
485
+ 2 14 #text 0 1
486
+
487
+ 1 15 g 0 0
488
+ 1 14 #text 0 1
489
+
490
+ 1 1 g 0 0
491
+ 2 14 #text 0 1
492
+
493
+ 2 1 path 1 0
494
+ 2 14 #text 0 1
495
+
496
+ 1 15 g 0 0
497
+ 1 14 #text 0 1
498
+
499
+ 1 1 g 0 0
500
+ 2 14 #text 0 1
501
+
502
+ 2 1 path 1 0
503
+ 2 14 #text 0 1
504
+
505
+ 1 15 g 0 0
506
+ 1 14 #text 0 1
507
+
508
+ 1 1 g 0 0
509
+ 2 14 #text 0 1
510
+
511
+ 2 1 path 1 0
512
+ 2 14 #text 0 1
513
+
514
+ 1 15 g 0 0
515
+ 1 14 #text 0 1
516
+
517
+ 1 1 g 0 0
518
+ 2 14 #text 0 1
519
+
520
+ 2 1 path 1 0
521
+ 2 14 #text 0 1
522
+
523
+ 1 15 g 0 0
524
+ 1 14 #text 0 1
525
+
526
+ 1 1 g 0 0
527
+ 2 14 #text 0 1
528
+
529
+ 2 1 path 1 0
530
+ 2 14 #text 0 1
531
+
532
+ 1 15 g 0 0
533
+ 1 14 #text 0 1
534
+
535
+ 1 1 g 0 0
536
+ 2 14 #text 0 1
537
+
538
+ 2 1 path 1 0
539
+ 2 14 #text 0 1
540
+
541
+ 1 15 g 0 0
542
+ 1 14 #text 0 1
543
+
544
+ 1 1 g 0 0
545
+ 2 14 #text 0 1
546
+
547
+ 2 1 path 1 0
548
+ 2 14 #text 0 1
549
+
550
+ 1 15 g 0 0
551
+ 1 14 #text 0 1
552
+
553
+ 1 1 g 0 0
554
+ 2 14 #text 0 1
555
+
556
+ 2 1 path 1 0
557
+ 2 14 #text 0 1
558
+
559
+ 1 15 g 0 0
560
+ 1 14 #text 0 1
561
+
562
+ 1 1 g 0 0
563
+ 2 14 #text 0 1
564
+
565
+ 2 1 path 1 0
566
+ 2 14 #text 0 1
567
+
568
+ 1 15 g 0 0
569
+ 1 14 #text 0 1
570
+
571
+ 1 1 g 0 0
572
+ 2 14 #text 0 1
573
+
574
+ 2 1 path 1 0
575
+ 2 14 #text 0 1
576
+
577
+ 1 15 g 0 0
578
+ 1 14 #text 0 1
579
+
580
+ 1 1 g 0 0
581
+ 2 14 #text 0 1
582
+
583
+ 2 1 path 1 0
584
+ 2 14 #text 0 1
585
+
586
+ 1 15 g 0 0
587
+ 1 14 #text 0 1
588
+
589
+ 1 1 g 0 0
590
+ 2 14 #text 0 1
591
+
592
+ 2 1 path 1 0
593
+ 2 14 #text 0 1
594
+
595
+ 1 15 g 0 0
596
+ 1 14 #text 0 1
597
+
598
+ 1 1 g 0 0
599
+ 2 14 #text 0 1
600
+
601
+ 2 1 path 1 0
602
+ 2 14 #text 0 1
603
+
604
+ 1 15 g 0 0
605
+ 1 14 #text 0 1
606
+
607
+ 1 1 g 0 0
608
+ 2 14 #text 0 1
609
+
610
+ 2 1 path 1 0
611
+ 2 14 #text 0 1
612
+
613
+ 1 15 g 0 0
614
+ 1 14 #text 0 1
615
+
616
+ 1 1 g 0 0
617
+ 2 14 #text 0 1
618
+
619
+ 2 1 path 1 0
620
+ 2 14 #text 0 1
621
+
622
+ 1 15 g 0 0
623
+ 1 14 #text 0 1
624
+
625
+ 1 1 g 0 0
626
+ 2 14 #text 0 1
627
+
628
+ 2 1 path 1 0
629
+ 2 14 #text 0 1
630
+
631
+ 1 15 g 0 0
632
+ 1 14 #text 0 1
633
+
634
+ 1 1 g 0 0
635
+ 2 14 #text 0 1
636
+
637
+ 2 1 path 1 0
638
+ 2 14 #text 0 1
639
+
640
+ 1 15 g 0 0
641
+ 1 14 #text 0 1
642
+
643
+ 1 1 g 0 0
644
+ 2 14 #text 0 1
645
+
646
+ 2 1 path 1 0
647
+ 2 14 #text 0 1
648
+
649
+ 1 15 g 0 0
650
+ 1 14 #text 0 1
651
+
652
+ 1 1 g 0 0
653
+ 2 14 #text 0 1
654
+
655
+ 2 1 path 1 0
656
+ 2 14 #text 0 1
657
+
658
+ 1 15 g 0 0
659
+ 1 14 #text 0 1
660
+
661
+ 1 1 g 0 0
662
+ 2 14 #text 0 1
663
+
664
+ 2 1 path 1 0
665
+ 2 14 #text 0 1
666
+
667
+ 1 15 g 0 0
668
+ 1 14 #text 0 1
669
+
670
+ 1 1 g 0 0
671
+ 2 14 #text 0 1
672
+
673
+ 2 1 path 1 0
674
+ 2 14 #text 0 1
675
+
676
+ 1 15 g 0 0
677
+ 1 14 #text 0 1
678
+
679
+ 1 1 g 0 0
680
+ 2 14 #text 0 1
681
+
682
+ 2 1 path 1 0
683
+ 2 14 #text 0 1
684
+
685
+ 1 15 g 0 0
686
+ 1 14 #text 0 1
687
+
688
+ 1 1 g 0 0
689
+ 2 14 #text 0 1
690
+
691
+ 2 1 path 1 0
692
+ 2 14 #text 0 1
693
+
694
+ 1 15 g 0 0
695
+ 1 14 #text 0 1
696
+
697
+ 1 1 g 0 0
698
+ 2 14 #text 0 1
699
+
700
+ 2 1 path 1 0
701
+ 2 14 #text 0 1
702
+
703
+ 1 15 g 0 0
704
+ 1 14 #text 0 1
705
+
706
+ 1 1 g 0 0
707
+ 2 14 #text 0 1
708
+
709
+ 2 1 path 1 0
710
+ 2 14 #text 0 1
711
+
712
+ 1 15 g 0 0
713
+ 1 14 #text 0 1
714
+
715
+ 1 1 g 0 0
716
+ 2 14 #text 0 1
717
+
718
+ 2 1 path 1 0
719
+ 2 14 #text 0 1
720
+
721
+ 1 15 g 0 0
722
+ 1 14 #text 0 1
723
+
724
+ 1 1 g 0 0
725
+ 2 14 #text 0 1
726
+
727
+ 2 1 path 1 0
728
+ 2 14 #text 0 1
729
+
730
+ 1 15 g 0 0
731
+ 1 14 #text 0 1
732
+
733
+ 1 1 g 0 0
734
+ 2 14 #text 0 1
735
+
736
+ 2 1 path 1 0
737
+ 2 14 #text 0 1
738
+
739
+ 1 15 g 0 0
740
+ 1 14 #text 0 1
741
+
742
+ 1 1 g 0 0
743
+ 2 14 #text 0 1
744
+
745
+ 2 1 path 1 0
746
+ 2 14 #text 0 1
747
+
748
+ 1 15 g 0 0
749
+ 1 14 #text 0 1
750
+
751
+ 1 1 g 0 0
752
+ 2 14 #text 0 1
753
+
754
+ 2 1 path 1 0
755
+ 2 14 #text 0 1
756
+
757
+ 1 15 g 0 0
758
+ 1 14 #text 0 1
759
+
760
+ 1 1 g 0 0
761
+ 2 14 #text 0 1
762
+
763
+ 2 1 path 1 0
764
+ 2 14 #text 0 1
765
+
766
+ 1 15 g 0 0
767
+ 1 14 #text 0 1
768
+
769
+ 1 1 g 0 0
770
+ 2 14 #text 0 1
771
+
772
+ 2 1 path 1 0
773
+ 2 14 #text 0 1
774
+
775
+ 1 15 g 0 0
776
+ 1 14 #text 0 1
777
+
778
+ 1 1 g 0 0
779
+ 2 14 #text 0 1
780
+
781
+ 2 1 path 1 0
782
+ 2 14 #text 0 1
783
+
784
+ 1 15 g 0 0
785
+ 1 14 #text 0 1
786
+
787
+ 1 1 g 0 0
788
+ 2 14 #text 0 1
789
+
790
+ 2 1 path 1 0
791
+ 2 14 #text 0 1
792
+
793
+ 1 15 g 0 0
794
+ 1 14 #text 0 1
795
+
796
+ 1 1 g 0 0
797
+ 2 14 #text 0 1
798
+
799
+ 2 1 path 1 0
800
+ 2 14 #text 0 1
801
+
802
+ 1 15 g 0 0
803
+ 1 14 #text 0 1
804
+
805
+ 1 1 g 0 0
806
+ 2 14 #text 0 1
807
+
808
+ 2 1 path 1 0
809
+ 2 14 #text 0 1
810
+
811
+ 1 15 g 0 0
812
+ 1 14 #text 0 1
813
+
814
+ 1 1 g 0 0
815
+ 2 14 #text 0 1
816
+
817
+ 2 1 path 1 0
818
+ 2 14 #text 0 1
819
+
820
+ 1 15 g 0 0
821
+ 1 14 #text 0 1
822
+
823
+ 1 1 g 0 0
824
+ 2 14 #text 0 1
825
+
826
+ 2 1 path 1 0
827
+ 2 14 #text 0 1
828
+
829
+ 1 15 g 0 0
830
+ 1 14 #text 0 1
831
+
832
+ 1 1 g 0 0
833
+ 2 14 #text 0 1
834
+
835
+ 2 1 path 1 0
836
+ 2 14 #text 0 1
837
+
838
+ 1 15 g 0 0
839
+ 1 14 #text 0 1
840
+
841
+ 1 1 g 0 0
842
+ 2 14 #text 0 1
843
+
844
+ 2 1 path 1 0
845
+ 2 14 #text 0 1
846
+
847
+ 1 15 g 0 0
848
+ 1 14 #text 0 1
849
+
850
+ 1 1 g 0 0
851
+ 2 14 #text 0 1
852
+
853
+ 2 1 path 1 0
854
+ 2 14 #text 0 1
855
+
856
+ 1 15 g 0 0
857
+ 1 14 #text 0 1
858
+
859
+ 1 1 g 0 0
860
+ 2 14 #text 0 1
861
+
862
+ 2 1 path 1 0
863
+ 2 14 #text 0 1
864
+
865
+ 1 15 g 0 0
866
+ 1 14 #text 0 1
867
+
868
+ 1 1 g 0 0
869
+ 2 14 #text 0 1
870
+
871
+ 2 1 path 1 0
872
+ 2 14 #text 0 1
873
+
874
+ 1 15 g 0 0
875
+ 1 14 #text 0 1
876
+
877
+ 1 1 g 0 0
878
+ 2 14 #text 0 1
879
+
880
+ 2 1 path 1 0
881
+ 2 14 #text 0 1
882
+
883
+ 1 15 g 0 0
884
+ 1 14 #text 0 1
885
+
886
+ 1 1 g 0 0
887
+ 2 14 #text 0 1
888
+
889
+ 2 1 path 1 0
890
+ 2 14 #text 0 1
891
+
892
+ 1 15 g 0 0
893
+ 1 14 #text 0 1
894
+
895
+ 1 1 g 0 0
896
+ 2 14 #text 0 1
897
+
898
+ 2 1 path 1 0
899
+ 2 14 #text 0 1
900
+
901
+ 1 15 g 0 0
902
+ 1 14 #text 0 1
903
+
904
+ 1 1 g 0 0
905
+ 2 14 #text 0 1
906
+
907
+ 2 1 path 1 0
908
+ 2 14 #text 0 1
909
+
910
+ 1 15 g 0 0
911
+ 1 14 #text 0 1
912
+
913
+ 1 1 g 0 0
914
+ 2 14 #text 0 1
915
+
916
+ 2 1 path 1 0
917
+ 2 14 #text 0 1
918
+
919
+ 1 15 g 0 0
920
+ 1 14 #text 0 1
921
+
922
+ 1 1 g 0 0
923
+ 2 14 #text 0 1
924
+
925
+ 2 1 path 1 0
926
+ 2 14 #text 0 1
927
+
928
+ 1 15 g 0 0
929
+ 1 14 #text 0 1
930
+
931
+ 1 1 g 0 0
932
+ 2 14 #text 0 1
933
+
934
+ 2 1 path 1 0
935
+ 2 14 #text 0 1
936
+
937
+ 1 15 g 0 0
938
+ 1 14 #text 0 1
939
+
940
+ 1 1 g 0 0
941
+ 2 14 #text 0 1
942
+
943
+ 2 1 path 1 0
944
+ 2 14 #text 0 1
945
+
946
+ 1 15 g 0 0
947
+ 1 14 #text 0 1
948
+
949
+ 1 1 g 0 0
950
+ 2 14 #text 0 1
951
+
952
+ 2 1 path 1 0
953
+ 2 14 #text 0 1
954
+
955
+ 1 15 g 0 0
956
+ 1 14 #text 0 1
957
+
958
+ 1 1 g 0 0
959
+ 2 14 #text 0 1
960
+
961
+ 2 1 path 1 0
962
+ 2 14 #text 0 1
963
+
964
+ 1 15 g 0 0
965
+ 1 14 #text 0 1
966
+
967
+ 1 1 g 0 0
968
+ 2 14 #text 0 1
969
+
970
+ 2 1 path 1 0
971
+ 2 14 #text 0 1
972
+
973
+ 1 15 g 0 0
974
+ 1 14 #text 0 1
975
+
976
+ 1 1 g 0 0
977
+ 2 14 #text 0 1
978
+
979
+ 2 1 path 1 0
980
+ 2 14 #text 0 1
981
+
982
+ 1 15 g 0 0
983
+ 1 14 #text 0 1
984
+
985
+ 1 1 g 0 0
986
+ 2 14 #text 0 1
987
+
988
+ 2 1 path 1 0
989
+ 2 14 #text 0 1
990
+
991
+ 1 15 g 0 0
992
+ 1 14 #text 0 1
993
+
994
+ 1 1 g 0 0
995
+ 2 14 #text 0 1
996
+
997
+ 2 1 path 1 0
998
+ 2 14 #text 0 1
999
+
1000
+ 1 15 g 0 0
1001
+ 1 14 #text 0 1
1002
+
1003
+ 1 1 g 0 0
1004
+ 2 14 #text 0 1
1005
+
1006
+ 2 1 path 1 0
1007
+ 2 14 #text 0 1
1008
+
1009
+ 1 15 g 0 0
1010
+ 1 14 #text 0 1
1011
+
1012
+ 1 1 g 0 0
1013
+ 2 14 #text 0 1
1014
+
1015
+ 2 1 path 1 0
1016
+ 2 14 #text 0 1
1017
+
1018
+ 1 15 g 0 0
1019
+ 1 14 #text 0 1
1020
+
1021
+ 1 1 g 0 0
1022
+ 2 14 #text 0 1
1023
+
1024
+ 2 1 path 1 0
1025
+ 2 14 #text 0 1
1026
+
1027
+ 1 15 g 0 0
1028
+ 1 14 #text 0 1
1029
+
1030
+ 1 1 g 0 0
1031
+ 2 14 #text 0 1
1032
+
1033
+ 2 1 path 1 0
1034
+ 2 14 #text 0 1
1035
+
1036
+ 1 15 g 0 0
1037
+ 1 14 #text 0 1
1038
+
1039
+ 1 1 g 0 0
1040
+ 2 14 #text 0 1
1041
+
1042
+ 2 1 path 1 0
1043
+ 2 14 #text 0 1
1044
+
1045
+ 1 15 g 0 0
1046
+ 1 14 #text 0 1
1047
+
1048
+ 1 1 g 0 0
1049
+ 2 14 #text 0 1
1050
+
1051
+ 2 1 path 1 0
1052
+ 2 14 #text 0 1
1053
+
1054
+ 1 15 g 0 0
1055
+ 1 14 #text 0 1
1056
+
1057
+ 1 1 g 0 0
1058
+ 2 14 #text 0 1
1059
+
1060
+ 2 1 path 1 0
1061
+ 2 14 #text 0 1
1062
+
1063
+ 1 15 g 0 0
1064
+ 1 14 #text 0 1
1065
+
1066
+ 1 1 g 0 0
1067
+ 2 14 #text 0 1
1068
+
1069
+ 2 1 path 1 0
1070
+ 2 14 #text 0 1
1071
+
1072
+ 1 15 g 0 0
1073
+ 1 14 #text 0 1
1074
+
1075
+ 1 1 g 0 0
1076
+ 2 14 #text 0 1
1077
+
1078
+ 2 1 path 1 0
1079
+ 2 14 #text 0 1
1080
+
1081
+ 1 15 g 0 0
1082
+ 1 14 #text 0 1
1083
+
1084
+ 1 1 g 0 0
1085
+ 2 14 #text 0 1
1086
+
1087
+ 2 1 path 1 0
1088
+ 2 14 #text 0 1
1089
+
1090
+ 1 15 g 0 0
1091
+ 1 14 #text 0 1
1092
+
1093
+ 1 1 g 0 0
1094
+ 2 14 #text 0 1
1095
+
1096
+ 2 1 path 1 0
1097
+ 2 14 #text 0 1
1098
+
1099
+ 1 15 g 0 0
1100
+ 1 14 #text 0 1
1101
+
1102
+ 1 1 g 0 0
1103
+ 2 14 #text 0 1
1104
+
1105
+ 2 1 path 1 0
1106
+ 2 14 #text 0 1
1107
+
1108
+ 1 15 g 0 0
1109
+ 1 14 #text 0 1
1110
+
1111
+ 1 1 g 0 0
1112
+ 2 14 #text 0 1
1113
+
1114
+ 2 1 path 1 0
1115
+ 2 14 #text 0 1
1116
+
1117
+ 1 15 g 0 0
1118
+ 1 14 #text 0 1
1119
+
1120
+ 1 1 g 0 0
1121
+ 2 14 #text 0 1
1122
+
1123
+ 2 1 path 1 0
1124
+ 2 14 #text 0 1
1125
+
1126
+ 1 15 g 0 0
1127
+ 1 14 #text 0 1
1128
+
1129
+ 1 1 g 0 0
1130
+ 2 14 #text 0 1
1131
+
1132
+ 2 1 path 1 0
1133
+ 2 14 #text 0 1
1134
+
1135
+ 1 15 g 0 0
1136
+ 1 14 #text 0 1
1137
+
1138
+ 1 1 g 0 0
1139
+ 2 14 #text 0 1
1140
+
1141
+ 2 1 path 1 0
1142
+ 2 14 #text 0 1
1143
+
1144
+ 1 15 g 0 0
1145
+ 1 14 #text 0 1
1146
+
1147
+ 1 1 g 0 0
1148
+ 2 14 #text 0 1
1149
+
1150
+ 2 1 path 1 0
1151
+ 2 14 #text 0 1
1152
+
1153
+ 1 15 g 0 0
1154
+ 1 14 #text 0 1
1155
+
1156
+ 1 1 g 0 0
1157
+ 2 14 #text 0 1
1158
+
1159
+ 2 1 path 1 0
1160
+ 2 14 #text 0 1
1161
+
1162
+ 1 15 g 0 0
1163
+ 1 14 #text 0 1
1164
+
1165
+ 1 1 g 0 0
1166
+ 2 14 #text 0 1
1167
+
1168
+ 2 1 path 1 0
1169
+ 2 14 #text 0 1
1170
+
1171
+ 1 15 g 0 0
1172
+ 1 14 #text 0 1
1173
+
1174
+ 1 1 g 0 0
1175
+ 2 14 #text 0 1
1176
+
1177
+ 2 1 path 1 0
1178
+ 2 14 #text 0 1
1179
+
1180
+ 1 15 g 0 0
1181
+ 1 14 #text 0 1
1182
+
1183
+ 1 1 g 0 0
1184
+ 2 14 #text 0 1
1185
+
1186
+ 2 1 path 1 0
1187
+ 2 14 #text 0 1
1188
+
1189
+ 1 15 g 0 0
1190
+ 1 14 #text 0 1
1191
+
1192
+ 1 1 g 0 0
1193
+ 2 14 #text 0 1
1194
+
1195
+ 2 1 path 1 0
1196
+ 2 14 #text 0 1
1197
+
1198
+ 1 15 g 0 0
1199
+ 1 14 #text 0 1
1200
+
1201
+ 1 1 g 0 0
1202
+ 2 14 #text 0 1
1203
+
1204
+ 2 1 path 1 0
1205
+ 2 14 #text 0 1
1206
+
1207
+ 1 15 g 0 0
1208
+ 1 14 #text 0 1
1209
+
1210
+ 1 1 g 0 0
1211
+ 2 14 #text 0 1
1212
+
1213
+ 2 1 path 1 0
1214
+ 2 14 #text 0 1
1215
+
1216
+ 1 15 g 0 0
1217
+ 1 14 #text 0 1
1218
+
1219
+ 1 1 g 0 0
1220
+ 2 14 #text 0 1
1221
+
1222
+ 2 1 path 1 0
1223
+ 2 14 #text 0 1
1224
+
1225
+ 1 15 g 0 0
1226
+ 1 14 #text 0 1
1227
+
1228
+ 1 1 g 0 0
1229
+ 2 14 #text 0 1
1230
+
1231
+ 2 1 path 1 0
1232
+ 2 14 #text 0 1
1233
+
1234
+ 1 15 g 0 0
1235
+ 1 14 #text 0 1
1236
+
1237
+ 1 1 g 0 0
1238
+ 2 14 #text 0 1
1239
+
1240
+ 2 1 path 1 0
1241
+ 2 14 #text 0 1
1242
+
1243
+ 1 15 g 0 0
1244
+ 1 14 #text 0 1
1245
+
1246
+ 1 1 g 0 0
1247
+ 2 14 #text 0 1
1248
+
1249
+ 2 1 path 1 0
1250
+ 2 14 #text 0 1
1251
+
1252
+ 1 15 g 0 0
1253
+ 1 14 #text 0 1
1254
+
1255
+ 1 1 g 0 0
1256
+ 2 14 #text 0 1
1257
+
1258
+ 2 1 path 1 0
1259
+ 2 14 #text 0 1
1260
+
1261
+ 1 15 g 0 0
1262
+ 1 14 #text 0 1
1263
+
1264
+ 1 1 g 0 0
1265
+ 2 14 #text 0 1
1266
+
1267
+ 2 1 path 1 0
1268
+ 2 14 #text 0 1
1269
+
1270
+ 1 15 g 0 0
1271
+ 1 14 #text 0 1
1272
+
1273
+ 1 1 g 0 0
1274
+ 2 14 #text 0 1
1275
+
1276
+ 2 1 path 1 0
1277
+ 2 14 #text 0 1
1278
+
1279
+ 1 15 g 0 0
1280
+ 1 14 #text 0 1
1281
+
1282
+ 1 1 g 0 0
1283
+ 2 14 #text 0 1
1284
+
1285
+ 2 1 path 1 0
1286
+ 2 14 #text 0 1
1287
+
1288
+ 1 15 g 0 0
1289
+ 1 14 #text 0 1
1290
+
1291
+ 1 1 g 0 0
1292
+ 2 14 #text 0 1
1293
+
1294
+ 2 1 path 1 0
1295
+ 2 14 #text 0 1
1296
+
1297
+ 1 15 g 0 0
1298
+ 1 14 #text 0 1
1299
+
1300
+ 1 1 g 0 0
1301
+ 2 14 #text 0 1
1302
+
1303
+ 2 1 path 1 0
1304
+ 2 14 #text 0 1
1305
+
1306
+ 1 15 g 0 0
1307
+ 1 14 #text 0 1
1308
+
1309
+ 1 1 g 0 0
1310
+ 2 14 #text 0 1
1311
+
1312
+ 2 1 path 1 0
1313
+ 2 14 #text 0 1
1314
+
1315
+ 1 15 g 0 0
1316
+ 1 14 #text 0 1
1317
+
1318
+ 1 1 g 0 0
1319
+ 2 14 #text 0 1
1320
+
1321
+ 2 1 path 1 0
1322
+ 2 14 #text 0 1
1323
+
1324
+ 1 15 g 0 0
1325
+ 1 14 #text 0 1
1326
+
1327
+ 1 1 g 0 0
1328
+ 2 14 #text 0 1
1329
+
1330
+ 2 1 path 1 0
1331
+ 2 14 #text 0 1
1332
+
1333
+ 1 15 g 0 0
1334
+ 1 14 #text 0 1
1335
+
1336
+ 1 1 g 0 0
1337
+ 2 14 #text 0 1
1338
+
1339
+ 2 1 path 1 0
1340
+ 2 14 #text 0 1
1341
+
1342
+ 1 15 g 0 0
1343
+ 1 14 #text 0 1
1344
+
1345
+ 1 1 g 0 0
1346
+ 2 14 #text 0 1
1347
+
1348
+ 2 1 path 1 0
1349
+ 2 14 #text 0 1
1350
+
1351
+ 1 15 g 0 0
1352
+ 1 14 #text 0 1
1353
+
1354
+ 1 1 g 0 0
1355
+ 2 14 #text 0 1
1356
+
1357
+ 2 1 path 1 0
1358
+ 2 14 #text 0 1
1359
+
1360
+ 1 15 g 0 0
1361
+ 1 14 #text 0 1
1362
+
1363
+ 1 1 g 0 0
1364
+ 2 14 #text 0 1
1365
+
1366
+ 2 1 path 1 0
1367
+ 2 14 #text 0 1
1368
+
1369
+ 1 15 g 0 0
1370
+ 1 14 #text 0 1
1371
+
1372
+ 1 1 g 0 0
1373
+ 2 14 #text 0 1
1374
+
1375
+ 2 1 path 1 0
1376
+ 2 14 #text 0 1
1377
+
1378
+ 1 15 g 0 0
1379
+ 1 14 #text 0 1
1380
+
1381
+ 1 1 g 0 0
1382
+ 2 14 #text 0 1
1383
+
1384
+ 2 1 path 1 0
1385
+ 2 14 #text 0 1
1386
+
1387
+ 1 15 g 0 0
1388
+ 1 14 #text 0 1
1389
+
1390
+ 1 1 g 0 0
1391
+ 2 14 #text 0 1
1392
+
1393
+ 2 1 path 1 0
1394
+ 2 14 #text 0 1
1395
+
1396
+ 1 15 g 0 0
1397
+ 1 14 #text 0 1
1398
+
1399
+ 1 1 g 0 0
1400
+ 2 14 #text 0 1
1401
+
1402
+ 2 1 path 1 0
1403
+ 2 14 #text 0 1
1404
+
1405
+ 1 15 g 0 0
1406
+ 1 14 #text 0 1
1407
+
1408
+ 1 1 g 0 0
1409
+ 2 14 #text 0 1
1410
+
1411
+ 2 1 path 1 0
1412
+ 2 14 #text 0 1
1413
+
1414
+ 1 15 g 0 0
1415
+ 1 14 #text 0 1
1416
+
1417
+ 1 1 g 0 0
1418
+ 2 14 #text 0 1
1419
+
1420
+ 2 1 path 1 0
1421
+ 2 14 #text 0 1
1422
+
1423
+ 1 15 g 0 0
1424
+ 1 14 #text 0 1
1425
+
1426
+ 1 1 g 0 0
1427
+ 2 14 #text 0 1
1428
+
1429
+ 2 1 path 1 0
1430
+ 2 14 #text 0 1
1431
+
1432
+ 1 15 g 0 0
1433
+ 1 14 #text 0 1
1434
+
1435
+ 1 1 g 0 0
1436
+ 2 14 #text 0 1
1437
+
1438
+ 2 1 path 1 0
1439
+ 2 14 #text 0 1
1440
+
1441
+ 1 15 g 0 0
1442
+ 1 14 #text 0 1
1443
+
1444
+ 1 1 g 0 0
1445
+ 2 14 #text 0 1
1446
+
1447
+ 2 1 path 1 0
1448
+ 2 14 #text 0 1
1449
+
1450
+ 1 15 g 0 0
1451
+ 1 14 #text 0 1
1452
+
1453
+ 1 1 g 0 0
1454
+ 2 14 #text 0 1
1455
+
1456
+ 2 1 path 1 0
1457
+ 2 14 #text 0 1
1458
+
1459
+ 1 15 g 0 0
1460
+ 1 14 #text 0 1
1461
+
1462
+ 1 1 g 0 0
1463
+ 2 14 #text 0 1
1464
+
1465
+ 2 1 path 1 0
1466
+ 2 14 #text 0 1
1467
+
1468
+ 1 15 g 0 0
1469
+ 1 14 #text 0 1
1470
+
1471
+ 1 1 g 0 0
1472
+ 2 14 #text 0 1
1473
+
1474
+ 2 1 path 1 0
1475
+ 2 14 #text 0 1
1476
+
1477
+ 1 15 g 0 0
1478
+ 1 14 #text 0 1
1479
+
1480
+ 1 1 g 0 0
1481
+ 2 14 #text 0 1
1482
+
1483
+ 2 1 path 1 0
1484
+ 2 14 #text 0 1
1485
+
1486
+ 1 15 g 0 0
1487
+ 1 14 #text 0 1
1488
+
1489
+ 1 1 g 0 0
1490
+ 2 14 #text 0 1
1491
+
1492
+ 2 1 path 1 0
1493
+ 2 14 #text 0 1
1494
+
1495
+ 1 15 g 0 0
1496
+ 1 14 #text 0 1
1497
+
1498
+ 1 1 g 0 0
1499
+ 2 14 #text 0 1
1500
+
1501
+ 2 1 path 1 0
1502
+ 2 14 #text 0 1
1503
+
1504
+ 1 15 g 0 0
1505
+ 1 14 #text 0 1
1506
+
1507
+ 1 1 g 0 0
1508
+ 2 14 #text 0 1
1509
+
1510
+ 2 1 path 1 0
1511
+ 2 14 #text 0 1
1512
+
1513
+ 1 15 g 0 0
1514
+ 1 14 #text 0 1
1515
+
1516
+ 1 1 g 0 0
1517
+ 2 14 #text 0 1
1518
+
1519
+ 2 1 path 1 0
1520
+ 2 14 #text 0 1
1521
+
1522
+ 1 15 g 0 0
1523
+ 1 14 #text 0 1
1524
+
1525
+ 1 1 g 0 0
1526
+ 2 14 #text 0 1
1527
+
1528
+ 2 1 path 1 0
1529
+ 2 14 #text 0 1
1530
+
1531
+ 1 15 g 0 0
1532
+ 1 14 #text 0 1
1533
+
1534
+ 1 1 g 0 0
1535
+ 2 14 #text 0 1
1536
+
1537
+ 2 1 path 1 0
1538
+ 2 14 #text 0 1
1539
+
1540
+ 1 15 g 0 0
1541
+ 1 14 #text 0 1
1542
+
1543
+ 1 1 g 0 0
1544
+ 2 14 #text 0 1
1545
+
1546
+ 2 1 path 1 0
1547
+ 2 14 #text 0 1
1548
+
1549
+ 1 15 g 0 0
1550
+ 1 14 #text 0 1
1551
+
1552
+ 1 1 g 0 0
1553
+ 2 14 #text 0 1
1554
+
1555
+ 2 1 path 1 0
1556
+ 2 14 #text 0 1
1557
+
1558
+ 1 15 g 0 0
1559
+ 1 14 #text 0 1
1560
+
1561
+ 1 1 g 0 0
1562
+ 2 14 #text 0 1
1563
+
1564
+ 2 1 path 1 0
1565
+ 2 14 #text 0 1
1566
+
1567
+ 1 15 g 0 0
1568
+ 1 14 #text 0 1
1569
+
1570
+ 1 1 g 0 0
1571
+ 2 14 #text 0 1
1572
+
1573
+ 2 1 path 1 0
1574
+ 2 14 #text 0 1
1575
+
1576
+ 1 15 g 0 0
1577
+ 1 14 #text 0 1
1578
+
1579
+ 1 1 g 0 0
1580
+ 2 14 #text 0 1
1581
+
1582
+ 2 1 path 1 0
1583
+ 2 14 #text 0 1
1584
+
1585
+ 1 15 g 0 0
1586
+ 1 14 #text 0 1
1587
+
1588
+ 1 1 g 0 0
1589
+ 2 14 #text 0 1
1590
+
1591
+ 2 1 path 1 0
1592
+ 2 14 #text 0 1
1593
+
1594
+ 1 15 g 0 0
1595
+ 1 14 #text 0 1
1596
+
1597
+ 1 1 g 0 0
1598
+ 2 14 #text 0 1
1599
+
1600
+ 2 1 path 1 0
1601
+ 2 14 #text 0 1
1602
+
1603
+ 1 15 g 0 0
1604
+ 1 14 #text 0 1
1605
+
1606
+ 1 1 g 0 0
1607
+ 2 14 #text 0 1
1608
+
1609
+ 2 1 path 1 0
1610
+ 2 14 #text 0 1
1611
+
1612
+ 1 15 g 0 0
1613
+ 1 14 #text 0 1
1614
+
1615
+ 1 1 g 0 0
1616
+ 2 14 #text 0 1
1617
+
1618
+ 2 1 path 1 0
1619
+ 2 14 #text 0 1
1620
+
1621
+ 1 15 g 0 0
1622
+ 1 14 #text 0 1
1623
+
1624
+ 1 1 g 0 0
1625
+ 2 14 #text 0 1
1626
+
1627
+ 2 1 path 1 0
1628
+ 2 14 #text 0 1
1629
+
1630
+ 1 15 g 0 0
1631
+ 1 14 #text 0 1
1632
+
1633
+ 1 1 g 0 0
1634
+ 2 14 #text 0 1
1635
+
1636
+ 2 1 path 1 0
1637
+ 2 14 #text 0 1
1638
+
1639
+ 1 15 g 0 0
1640
+ 1 14 #text 0 1
1641
+
1642
+ 1 1 g 0 0
1643
+ 2 14 #text 0 1
1644
+
1645
+ 2 1 path 1 0
1646
+ 2 14 #text 0 1
1647
+
1648
+ 1 15 g 0 0
1649
+ 1 14 #text 0 1
1650
+
1651
+ 1 1 g 0 0
1652
+ 2 14 #text 0 1
1653
+
1654
+ 2 1 path 1 0
1655
+ 2 14 #text 0 1
1656
+
1657
+ 1 15 g 0 0
1658
+ 1 14 #text 0 1
1659
+
1660
+ 1 1 g 0 0
1661
+ 2 14 #text 0 1
1662
+
1663
+ 2 1 path 1 0
1664
+ 2 14 #text 0 1
1665
+
1666
+ 1 15 g 0 0
1667
+ 1 14 #text 0 1
1668
+
1669
+ 1 1 g 0 0
1670
+ 2 14 #text 0 1
1671
+
1672
+ 2 1 path 1 0
1673
+ 2 14 #text 0 1
1674
+
1675
+ 1 15 g 0 0
1676
+ 1 14 #text 0 1
1677
+
1678
+ 1 1 g 0 0
1679
+ 2 14 #text 0 1
1680
+
1681
+ 2 1 path 1 0
1682
+ 2 14 #text 0 1
1683
+
1684
+ 1 15 g 0 0
1685
+ 1 14 #text 0 1
1686
+
1687
+ 1 1 g 0 0
1688
+ 2 14 #text 0 1
1689
+
1690
+ 2 1 path 1 0
1691
+ 2 14 #text 0 1
1692
+
1693
+ 1 15 g 0 0
1694
+ 1 14 #text 0 1
1695
+
1696
+ 1 1 g 0 0
1697
+ 2 14 #text 0 1
1698
+
1699
+ 2 1 path 1 0
1700
+ 2 14 #text 0 1
1701
+
1702
+ 1 15 g 0 0
1703
+ 1 14 #text 0 1
1704
+
1705
+ 1 1 g 0 0
1706
+ 2 14 #text 0 1
1707
+
1708
+ 2 1 path 1 0
1709
+ 2 14 #text 0 1
1710
+
1711
+ 1 15 g 0 0
1712
+ 1 14 #text 0 1
1713
+
1714
+ 1 1 g 0 0
1715
+ 2 14 #text 0 1
1716
+
1717
+ 2 1 path 1 0
1718
+ 2 14 #text 0 1
1719
+
1720
+ 1 15 g 0 0
1721
+ 1 14 #text 0 1
1722
+
1723
+ 1 1 g 0 0
1724
+ 2 14 #text 0 1
1725
+
1726
+ 2 1 path 1 0
1727
+ 2 14 #text 0 1
1728
+
1729
+ 1 15 g 0 0
1730
+ 1 14 #text 0 1
1731
+
1732
+ 1 1 g 0 0
1733
+ 2 14 #text 0 1
1734
+
1735
+ 2 1 path 1 0
1736
+ 2 14 #text 0 1
1737
+
1738
+ 1 15 g 0 0
1739
+ 1 14 #text 0 1
1740
+
1741
+ 1 1 g 0 0
1742
+ 2 14 #text 0 1
1743
+
1744
+ 2 1 path 1 0
1745
+ 2 14 #text 0 1
1746
+
1747
+ 1 15 g 0 0
1748
+ 1 14 #text 0 1
1749
+
1750
+ 1 1 g 0 0
1751
+ 2 14 #text 0 1
1752
+
1753
+ 2 1 path 1 0
1754
+ 2 14 #text 0 1
1755
+
1756
+ 1 15 g 0 0
1757
+ 1 14 #text 0 1
1758
+
1759
+ 1 1 g 0 0
1760
+ 2 14 #text 0 1
1761
+
1762
+ 2 1 path 1 0
1763
+ 2 14 #text 0 1
1764
+
1765
+ 1 15 g 0 0
1766
+ 1 14 #text 0 1
1767
+
1768
+ 1 1 g 0 0
1769
+ 2 14 #text 0 1
1770
+
1771
+ 2 1 path 1 0
1772
+ 2 14 #text 0 1
1773
+
1774
+ 1 15 g 0 0
1775
+ 1 14 #text 0 1
1776
+
1777
+ 1 1 g 0 0
1778
+ 2 14 #text 0 1
1779
+
1780
+ 2 1 path 1 0
1781
+ 2 14 #text 0 1
1782
+
1783
+ 1 15 g 0 0
1784
+ 1 14 #text 0 1
1785
+
1786
+ 1 1 g 0 0
1787
+ 2 14 #text 0 1
1788
+
1789
+ 2 1 path 1 0
1790
+ 2 14 #text 0 1
1791
+
1792
+ 1 15 g 0 0
1793
+ 1 14 #text 0 1
1794
+
1795
+ 1 1 g 0 0
1796
+ 2 14 #text 0 1
1797
+
1798
+ 2 1 path 1 0
1799
+ 2 14 #text 0 1
1800
+
1801
+ 1 15 g 0 0
1802
+ 1 14 #text 0 1
1803
+
1804
+ 1 1 g 0 0
1805
+ 2 14 #text 0 1
1806
+
1807
+ 2 1 path 1 0
1808
+ 2 14 #text 0 1
1809
+
1810
+ 1 15 g 0 0
1811
+ 1 14 #text 0 1
1812
+
1813
+ 1 1 g 0 0
1814
+ 2 14 #text 0 1
1815
+
1816
+ 2 1 path 1 0
1817
+ 2 14 #text 0 1
1818
+
1819
+ 1 15 g 0 0
1820
+ 1 14 #text 0 1
1821
+
1822
+ 1 1 g 0 0
1823
+ 2 14 #text 0 1
1824
+
1825
+ 2 1 path 1 0
1826
+ 2 14 #text 0 1
1827
+
1828
+ 1 15 g 0 0
1829
+ 1 14 #text 0 1
1830
+
1831
+ 1 1 g 0 0
1832
+ 2 14 #text 0 1
1833
+
1834
+ 2 1 path 1 0
1835
+ 2 14 #text 0 1
1836
+
1837
+ 1 15 g 0 0
1838
+ 1 14 #text 0 1
1839
+
1840
+ 1 1 g 0 0
1841
+ 2 14 #text 0 1
1842
+
1843
+ 2 1 path 1 0
1844
+ 2 14 #text 0 1
1845
+
1846
+ 1 15 g 0 0
1847
+ 1 14 #text 0 1
1848
+
1849
+ 1 1 g 0 0
1850
+ 2 14 #text 0 1
1851
+
1852
+ 2 1 path 1 0
1853
+ 2 14 #text 0 1
1854
+
1855
+ 1 15 g 0 0
1856
+ 1 14 #text 0 1
1857
+
1858
+ 1 1 g 0 0
1859
+ 2 14 #text 0 1
1860
+
1861
+ 2 1 path 1 0
1862
+ 2 14 #text 0 1
1863
+
1864
+ 1 15 g 0 0
1865
+ 1 14 #text 0 1
1866
+
1867
+ 1 1 g 0 0
1868
+ 2 14 #text 0 1
1869
+
1870
+ 2 1 path 1 0
1871
+ 2 14 #text 0 1
1872
+
1873
+ 1 15 g 0 0
1874
+ 1 14 #text 0 1
1875
+
1876
+ 1 1 g 0 0
1877
+ 2 14 #text 0 1
1878
+
1879
+ 2 1 path 1 0
1880
+ 2 14 #text 0 1
1881
+
1882
+ 1 15 g 0 0
1883
+ 1 14 #text 0 1
1884
+
1885
+ 1 1 g 0 0
1886
+ 2 14 #text 0 1
1887
+
1888
+ 2 1 path 1 0
1889
+ 2 14 #text 0 1
1890
+
1891
+ 1 15 g 0 0
1892
+ 1 14 #text 0 1
1893
+
1894
+ 1 1 g 0 0
1895
+ 2 14 #text 0 1
1896
+
1897
+ 2 1 path 1 0
1898
+ 2 14 #text 0 1
1899
+
1900
+ 1 15 g 0 0
1901
+ 1 14 #text 0 1
1902
+
1903
+ 1 1 g 0 0
1904
+ 2 14 #text 0 1
1905
+
1906
+ 2 1 path 1 0
1907
+ 2 14 #text 0 1
1908
+
1909
+ 1 15 g 0 0
1910
+ 1 14 #text 0 1
1911
+
1912
+ 1 1 g 0 0
1913
+ 2 14 #text 0 1
1914
+
1915
+ 2 1 path 1 0
1916
+ 2 14 #text 0 1
1917
+
1918
+ 1 15 g 0 0
1919
+ 1 14 #text 0 1
1920
+
1921
+ 1 1 g 0 0
1922
+ 2 14 #text 0 1
1923
+
1924
+ 2 1 path 1 0
1925
+ 2 14 #text 0 1
1926
+
1927
+ 1 15 g 0 0
1928
+ 1 14 #text 0 1
1929
+
1930
+ 1 1 g 0 0
1931
+ 2 14 #text 0 1
1932
+
1933
+ 2 1 path 1 0
1934
+ 2 14 #text 0 1
1935
+
1936
+ 1 15 g 0 0
1937
+ 1 14 #text 0 1
1938
+
1939
+ 1 1 g 0 0
1940
+ 2 14 #text 0 1
1941
+
1942
+ 2 1 path 1 0
1943
+ 2 14 #text 0 1
1944
+
1945
+ 1 15 g 0 0
1946
+ 1 14 #text 0 1
1947
+
1948
+ 1 1 g 0 0
1949
+ 2 14 #text 0 1
1950
+
1951
+ 2 1 path 1 0
1952
+ 2 14 #text 0 1
1953
+
1954
+ 1 15 g 0 0
1955
+ 1 14 #text 0 1
1956
+
1957
+ 1 1 g 0 0
1958
+ 2 14 #text 0 1
1959
+
1960
+ 2 1 path 1 0
1961
+ 2 14 #text 0 1
1962
+
1963
+ 1 15 g 0 0
1964
+ 1 14 #text 0 1
1965
+
1966
+ 1 1 g 0 0
1967
+ 2 14 #text 0 1
1968
+
1969
+ 2 1 path 1 0
1970
+ 2 14 #text 0 1
1971
+
1972
+ 1 15 g 0 0
1973
+ 1 14 #text 0 1
1974
+
1975
+ 1 1 g 0 0
1976
+ 2 14 #text 0 1
1977
+
1978
+ 2 1 path 1 0
1979
+ 2 14 #text 0 1
1980
+
1981
+ 1 15 g 0 0
1982
+ 1 14 #text 0 1
1983
+
1984
+ 1 1 g 0 0
1985
+ 2 14 #text 0 1
1986
+
1987
+ 2 1 path 1 0
1988
+ 2 14 #text 0 1
1989
+
1990
+ 1 15 g 0 0
1991
+ 1 14 #text 0 1
1992
+
1993
+ 1 1 g 0 0
1994
+ 2 14 #text 0 1
1995
+
1996
+ 2 1 path 1 0
1997
+ 2 14 #text 0 1
1998
+
1999
+ 1 15 g 0 0
2000
+ 1 14 #text 0 1
2001
+
2002
+ 1 1 g 0 0
2003
+ 2 14 #text 0 1
2004
+
2005
+ 2 1 path 1 0
2006
+ 2 14 #text 0 1
2007
+
2008
+ 1 15 g 0 0
2009
+ 1 14 #text 0 1
2010
+
2011
+ 1 1 g 0 0
2012
+ 2 14 #text 0 1
2013
+
2014
+ 2 1 path 1 0
2015
+ 2 14 #text 0 1
2016
+
2017
+ 1 15 g 0 0
2018
+ 1 14 #text 0 1
2019
+
2020
+ 1 1 g 0 0
2021
+ 2 14 #text 0 1
2022
+
2023
+ 2 1 path 1 0
2024
+ 2 14 #text 0 1
2025
+
2026
+ 1 15 g 0 0
2027
+ 1 14 #text 0 1
2028
+
2029
+ 1 1 g 0 0
2030
+ 2 14 #text 0 1
2031
+
2032
+ 2 1 path 1 0
2033
+ 2 14 #text 0 1
2034
+
2035
+ 1 15 g 0 0
2036
+ 1 14 #text 0 1
2037
+
2038
+ 1 1 g 0 0
2039
+ 2 14 #text 0 1
2040
+
2041
+ 2 1 path 1 0
2042
+ 2 14 #text 0 1
2043
+
2044
+ 1 15 g 0 0
2045
+ 1 14 #text 0 1
2046
+
2047
+ 1 1 g 0 0
2048
+ 2 14 #text 0 1
2049
+
2050
+ 2 1 path 1 0
2051
+ 2 14 #text 0 1
2052
+
2053
+ 1 15 g 0 0
2054
+ 1 14 #text 0 1
2055
+
2056
+ 1 1 g 0 0
2057
+ 2 14 #text 0 1
2058
+
2059
+ 2 1 path 1 0
2060
+ 2 14 #text 0 1
2061
+
2062
+ 1 15 g 0 0
2063
+ 1 14 #text 0 1
2064
+
2065
+ 1 1 g 0 0
2066
+ 2 14 #text 0 1
2067
+
2068
+ 2 1 path 1 0
2069
+ 2 14 #text 0 1
2070
+
2071
+ 1 15 g 0 0
2072
+ 1 14 #text 0 1
2073
+
2074
+ 1 1 g 0 0
2075
+ 2 14 #text 0 1
2076
+
2077
+ 2 1 path 1 0
2078
+ 2 14 #text 0 1
2079
+
2080
+ 1 15 g 0 0
2081
+ 1 14 #text 0 1
2082
+
2083
+ 1 1 g 0 0
2084
+ 2 14 #text 0 1
2085
+
2086
+ 2 1 path 1 0
2087
+ 2 14 #text 0 1
2088
+
2089
+ 1 15 g 0 0
2090
+ 1 14 #text 0 1
2091
+
2092
+ 1 1 g 0 0
2093
+ 2 14 #text 0 1
2094
+
2095
+ 2 1 path 1 0
2096
+ 2 14 #text 0 1
2097
+
2098
+ 1 15 g 0 0
2099
+ 1 14 #text 0 1
2100
+
2101
+ 1 1 g 0 0
2102
+ 2 14 #text 0 1
2103
+
2104
+ 2 1 path 1 0
2105
+ 2 14 #text 0 1
2106
+
2107
+ 1 15 g 0 0
2108
+ 1 14 #text 0 1
2109
+
2110
+ 1 1 g 0 0
2111
+ 2 14 #text 0 1
2112
+
2113
+ 2 1 path 1 0
2114
+ 2 14 #text 0 1
2115
+
2116
+ 1 15 g 0 0
2117
+ 1 14 #text 0 1
2118
+
2119
+ 1 1 g 0 0
2120
+ 2 14 #text 0 1
2121
+
2122
+ 2 1 path 1 0
2123
+ 2 14 #text 0 1
2124
+
2125
+ 1 15 g 0 0
2126
+ 1 14 #text 0 1
2127
+
2128
+ 1 1 g 0 0
2129
+ 2 14 #text 0 1
2130
+
2131
+ 2 1 path 1 0
2132
+ 2 14 #text 0 1
2133
+
2134
+ 1 15 g 0 0
2135
+ 1 14 #text 0 1
2136
+
2137
+ 1 1 g 0 0
2138
+ 2 14 #text 0 1
2139
+
2140
+ 2 1 path 1 0
2141
+ 2 14 #text 0 1
2142
+
2143
+ 1 15 g 0 0
2144
+ 1 14 #text 0 1
2145
+
2146
+ 1 1 g 0 0
2147
+ 2 14 #text 0 1
2148
+
2149
+ 2 1 path 1 0
2150
+ 2 14 #text 0 1
2151
+
2152
+ 1 15 g 0 0
2153
+ 1 14 #text 0 1
2154
+
2155
+ 1 1 g 0 0
2156
+ 2 14 #text 0 1
2157
+
2158
+ 2 1 path 1 0
2159
+ 2 14 #text 0 1
2160
+
2161
+ 1 15 g 0 0
2162
+ 1 14 #text 0 1
2163
+
2164
+ 0 15 svg 0 0
local-test-libxml2-full-01/afc-libxml2/result/xml1.rde ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ 0 10 test 0 0
2
+ 0 1 test 0 0
3
+ 1 1 p 0 0
4
+ 2 3 #text 0 1 An ampersand (&) may be escaped
5
+ numerically (&#38;) or with a general entity
6
+ (&amp;).
7
+ 1 15 p 0 0
8
+ 0 15 test 0 0
local-test-libxml2-full-01/afc-libxml2/test/HTML/53867.html ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html>
2
+ <head>
3
+ <style>
4
+ .......
5
+ ...............................................................
6
+ ...............................................................
7
+ ...............................................................
8
+ ...............................................................
9
+ ...............................................................
10
+ ...............................................................
11
+ ...............................................................
12
+ ...............................................................
13
+ ...............................................................
14
+ ...............................................................
15
+ ...............................................................
16
+ ...............................................................
17
+ ...............................................................
18
+ ...............................................................
19
+ ...............................................................
20
+ ...............................................................
21
+ ...............................................................
22
+ ...............................................................
23
+ ...............................................................
24
+ ...............................................................
25
+ ...............................................................
26
+ ...............................................................
27
+ ...............................................................
28
+ ...............................................................
29
+ ...............................................................
30
+ ...............................................................
31
+ ...............................................................
32
+ ...............................................................
33
+ ...............................................................
34
+ ...............................................................
35
+ ...............................................................
36
+ ...............................................................
37
+ ...............................................................
38
+ ...............................................................
39
+ ...............................................................
40
+ ...............................................................
41
+ ...............................................................
42
+ ...............................................................
43
+ ...............................................................
44
+ ...............................................................
45
+ ...............................................................
46
+ ...............................................................
47
+ ...............................................................
48
+ ...............................................................
49
+ ...............................................................
50
+ ...............................................................
51
+ ...............................................................
52
+ ...............................................................
53
+ ...............................................................
54
+ ...............................................................
55
+ ...............................................................
56
+ ...............................................................
57
+ ...............................................................
58
+ ...............................................................
59
+ ...............................................................
60
+ ...............................................................
61
+ ...............................................................
62
+ ...............................................................
63
+ ...............................................................
64
+ ...............................................................
65
+ ...............................................................
66
+ ...............................................................
67
+ </style>
68
+ </head>
69
+ </html>
local-test-libxml2-full-01/afc-libxml2/test/HTML/758518-entity.html ADDED
@@ -0,0 +1 @@
 
 
1
+ &j�
local-test-libxml2-full-01/afc-libxml2/test/HTML/758518-tag.html ADDED
@@ -0,0 +1 @@
 
 
1
+ <?a�
local-test-libxml2-full-01/afc-libxml2/test/HTML/758605.html ADDED
@@ -0,0 +1 @@
 
 
1
+ &:�
local-test-libxml2-full-01/afc-libxml2/test/HTML/758606.html ADDED
@@ -0,0 +1 @@
 
 
1
+ <!-- <!doctype
local-test-libxml2-full-01/afc-libxml2/test/HTML/758606_2.html ADDED
@@ -0,0 +1 @@
 
 
1
+ <!-- �<!dOctYPE
local-test-libxml2-full-01/afc-libxml2/test/HTML/Down.html ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html>
2
+ <head>
3
+ <title>This service is temporary down</title>
4
+ </head>
5
+
6
+ <body bgcolor="#FFFFFF">
7
+ <h1 align="center">Sorry, this service is temporary down</h1>
8
+ We are doing our best to get it back on-line,
9
+
10
+ <p>The W3C system administrators</p>
11
+ </body>
12
+ </html>
local-test-libxml2-full-01/afc-libxml2/test/HTML/attr-ents.html ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ <html>
2
+ <body>
3
+ <a href="index.cgi?a&lt=1&gt=2">link</a>
4
+ <a href="index.cgi?a&lta&gta">link</a>
5
+ <a href="index.cgi?a&lt&gt">link</a>
6
+ </body>
7
+ </html>
local-test-libxml2-full-01/afc-libxml2/test/HTML/attrents.html ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ <html>
2
+ <body bgcolor="#FFFFFF">
3
+ <a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#107;&#97;&#116;&#104;&#101;&#114;&#105;&#110;&#101;&#64;&#99;&#98;&#102;&#97;&#110;&#99;&#46;&#111;&#114;&#103;&#44;&#119;&#101;&#98;&#115;&#105;&#116;&#101;&#64;&#98;&#105;&#115;&#46;&#100;&#111;&#99;&#46;&#103;&#111;&#118;&#63;&#115;&#117;&#98;&#106;&#101;&#99;&#116;&#61;&#83;&#111;&#117;&#116;&#104;&#32;&#83;&#97;&#110;&#32;&#70;&#114;&#97;&#110;&#99;&#105;&#115;&#99;&#111;&#32;&#66;&#73;&#83;&#32;&#83;&#101;&#109;&#105;&#110;&#97;&#114;&#32;&#45;&#32;&#79;&#99;&#116;&#111;&#98;&#101;&#114;&#32;&#49;&#54;&#116;&#104;"></a><br>
4
+ </body>
5
+ </html>