VirtualBox

source: vbox/trunk/src/libs/libxml2-2.9.14/fuzz/fuzz.h@ 102797

Last change on this file since 102797 was 95312, checked in by vboxsync, 3 years ago

libs/{curl,libxml2}: OSE export fixes, bugref:8515

  • Property svn:eol-style set to native
File size: 1.7 KB
Line 
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
15extern "C" {
16#endif
17
18#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
19 #define HAVE_HTML_FUZZER
20#endif
21#if defined(LIBXML_REGEXP_ENABLED)
22 #define HAVE_REGEXP_FUZZER
23#endif
24#if defined(LIBXML_SCHEMAS_ENABLED)
25 #define HAVE_SCHEMA_FUZZER
26#endif
27#if 1
28 #define HAVE_URI_FUZZER
29#endif
30#if defined(LIBXML_OUTPUT_ENABLED) && \
31 defined(LIBXML_READER_ENABLED) && \
32 defined(LIBXML_XINCLUDE_ENABLED)
33 #define HAVE_XML_FUZZER
34#endif
35#if defined(LIBXML_XPATH_ENABLED)
36 #define HAVE_XPATH_FUZZER
37#endif
38
39int
40LLVMFuzzerInitialize(int *argc, char ***argv);
41
42int
43LLVMFuzzerTestOneInput(const char *data, size_t size);
44
45void
46xmlFuzzErrorFunc(void *ctx ATTRIBUTE_UNUSED, const char *msg ATTRIBUTE_UNUSED,
47 ...);
48
49void
50xmlFuzzDataInit(const char *data, size_t size);
51
52void
53xmlFuzzDataCleanup(void);
54
55int
56xmlFuzzReadInt(void);
57
58const char *
59xmlFuzzReadRemaining(size_t *size);
60
61void
62xmlFuzzWriteString(FILE *out, const char *str);
63
64const char *
65xmlFuzzReadString(size_t *size);
66
67void
68xmlFuzzReadEntities(void);
69
70const char *
71xmlFuzzMainUrl(void);
72
73const char *
74xmlFuzzMainEntity(size_t *size);
75
76xmlParserInputPtr
77xmlFuzzEntityLoader(const char *URL, const char *ID, xmlParserCtxtPtr ctxt);
78
79size_t
80xmlFuzzExtractStrings(const char *data, size_t size, char **strings,
81 size_t numStrings);
82
83char *
84xmlSlurpFile(const char *path, size_t *size);
85
86#ifdef __cplusplus
87}
88#endif
89
90#endif /* __XML_FUZZERCOMMON_H__ */
91
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette