VirtualBox

source: vbox/trunk/src/libs/libxml2-2.12.6/fuzz/fuzz.h@ 104201

最後變更 在這個檔案從104201是 104106,由 vboxsync 提交於 10 月 前

libxml2-2.9.14: Applied and adjusted our libxml2 changes to 2.9.14. bugref:10640

  • 屬性 svn:eol-style 設為 native
檔案大小: 1.7 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 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_VALID_ENABLED)
31 #define HAVE_VALID_FUZZER
32#endif
33#if defined(LIBXML_XINCLUDE_ENABLED)
34 #define HAVE_XINCLUDE_FUZZER
35#endif
36#if 1
37 #define HAVE_XML_FUZZER
38#endif
39#if defined(LIBXML_XPTR_ENABLED)
40 #define HAVE_XPATH_FUZZER
41#endif
42
43int
44LLVMFuzzerInitialize(int *argc, char ***argv);
45
46int
47LLVMFuzzerTestOneInput(const char *data, size_t size);
48
49void
50xmlFuzzErrorFunc(void *ctx ATTRIBUTE_UNUSED, const char *msg ATTRIBUTE_UNUSED,
51 ...);
52
53void
54xmlFuzzMemSetup(void);
55
56void
57xmlFuzzMemSetLimit(size_t limit);
58
59int
60xmlFuzzMallocFailed(void);
61
62void
63xmlFuzzDataInit(const char *data, size_t size);
64
65void
66xmlFuzzDataCleanup(void);
67
68void
69xmlFuzzWriteInt(FILE *out, size_t v, int size);
70
71size_t
72xmlFuzzReadInt(int size);
73
74const char *
75xmlFuzzReadRemaining(size_t *size);
76
77void
78xmlFuzzWriteString(FILE *out, const char *str);
79
80const char *
81xmlFuzzReadString(size_t *size);
82
83void
84xmlFuzzReadEntities(void);
85
86const char *
87xmlFuzzMainUrl(void);
88
89const char *
90xmlFuzzMainEntity(size_t *size);
91
92xmlParserInputPtr
93xmlFuzzEntityLoader(const char *URL, const char *ID, xmlParserCtxtPtr ctxt);
94
95char *
96xmlSlurpFile(const char *path, size_t *size);
97
98#ifdef __cplusplus
99}
100#endif
101
102#endif /* __XML_FUZZERCOMMON_H__ */
103
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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