VirtualBox

source: vbox/trunk/src/libs/libxml2-2.13.2/fuzz/fuzz.h@ 105764

最後變更 在這個檔案從105764是 105420,由 vboxsync 提交於 4 月 前

libxml2-2.12.6: Applied and adjusted our libxml2 changes to 2.12.6. bugref:10730

  • 屬性 svn:eol-style 設為 native
檔案大小: 2.0 KB
 
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)
19 #define HAVE_HTML_FUZZER
20#endif
21#if 1
22 #define HAVE_LINT_FUZZER
23#endif
24#if defined(LIBXML_READER_ENABLED)
25 #define HAVE_READER_FUZZER
26#endif
27#if defined(LIBXML_REGEXP_ENABLED)
28 #define HAVE_REGEXP_FUZZER
29#endif
30#if defined(LIBXML_SCHEMAS_ENABLED)
31 #define HAVE_SCHEMA_FUZZER
32#endif
33#if 1
34 #define HAVE_URI_FUZZER
35#endif
36#if defined(LIBXML_VALID_ENABLED)
37 #define HAVE_VALID_FUZZER
38#endif
39#if defined(LIBXML_XINCLUDE_ENABLED)
40 #define HAVE_XINCLUDE_FUZZER
41#endif
42#if 1
43 #define HAVE_XML_FUZZER
44#endif
45#if defined(LIBXML_XPTR_ENABLED)
46 #define HAVE_XPATH_FUZZER
47#endif
48
49int
50LLVMFuzzerInitialize(int *argc, char ***argv);
51
52int
53LLVMFuzzerTestOneInput(const char *data, size_t size);
54
55void
56xmlFuzzErrorFunc(void *ctx ATTRIBUTE_UNUSED, const char *msg ATTRIBUTE_UNUSED,
57 ...);
58
59void
60xmlFuzzMemSetup(void);
61
62void
63xmlFuzzMemSetLimit(size_t limit);
64
65int
66xmlFuzzMallocFailed(void);
67
68void
69xmlFuzzResetMallocFailed(void);
70
71void
72xmlFuzzCheckMallocFailure(const char *func, int expect);
73
74void
75xmlFuzzDataInit(const char *data, size_t size);
76
77void
78xmlFuzzDataCleanup(void);
79
80void
81xmlFuzzWriteInt(FILE *out, size_t v, int size);
82
83size_t
84xmlFuzzReadInt(int size);
85
86size_t
87xmlFuzzBytesRemaining(void);
88
89const char *
90xmlFuzzReadRemaining(size_t *size);
91
92void
93xmlFuzzWriteString(FILE *out, const char *str);
94
95const char *
96xmlFuzzReadString(size_t *size);
97
98void
99xmlFuzzReadEntities(void);
100
101const char *
102xmlFuzzMainUrl(void);
103
104const char *
105xmlFuzzMainEntity(size_t *size);
106
107xmlParserInputPtr
108xmlFuzzEntityLoader(const char *URL, const char *ID, xmlParserCtxtPtr ctxt);
109
110char *
111xmlSlurpFile(const char *path, size_t *size);
112
113#ifdef __cplusplus
114}
115#endif
116
117#endif /* __XML_FUZZERCOMMON_H__ */
118
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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