mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-01-19 10:03:34 +03:00
0d9da0290c
Run fuzz targets with files in seed corpus during test.
74 lines
1.3 KiB
C
74 lines
1.3 KiB
C
/*
|
|
* fuzz.h: Common functions and macros for fuzzing.
|
|
*
|
|
* See Copyright for the status of this software.
|
|
*/
|
|
|
|
#ifndef __XML_FUZZERCOMMON_H__
|
|
#define __XML_FUZZERCOMMON_H__
|
|
|
|
#include <stddef.h>
|
|
#include <stdio.h>
|
|
#include <libxml/parser.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
int
|
|
LLVMFuzzerInitialize(int *argc, char ***argv);
|
|
|
|
int
|
|
LLVMFuzzerTestOneInput(const char *data, size_t size);
|
|
|
|
void
|
|
xmlFuzzErrorFunc(void *ctx ATTRIBUTE_UNUSED, const char *msg ATTRIBUTE_UNUSED,
|
|
...);
|
|
|
|
void
|
|
xmlFuzzDataInit(const char *data, size_t size);
|
|
|
|
void
|
|
xmlFuzzDataCleanup(void);
|
|
|
|
int
|
|
xmlFuzzReadInt(void);
|
|
|
|
const char *
|
|
xmlFuzzReadRemaining(size_t *size);
|
|
|
|
void
|
|
xmlFuzzWriteString(FILE *out, const char *str);
|
|
|
|
const char *
|
|
xmlFuzzReadString(size_t *size);
|
|
|
|
xmlParserInputPtr
|
|
xmlFuzzEntityRecorder(const char *URL, const char *ID, xmlParserCtxtPtr ctxt);
|
|
|
|
void
|
|
xmlFuzzReadEntities(void);
|
|
|
|
const char *
|
|
xmlFuzzMainUrl(void);
|
|
|
|
const char *
|
|
xmlFuzzMainEntity(size_t *size);
|
|
|
|
xmlParserInputPtr
|
|
xmlFuzzEntityLoader(const char *URL, const char *ID, xmlParserCtxtPtr ctxt);
|
|
|
|
size_t
|
|
xmlFuzzExtractStrings(const char *data, size_t size, char **strings,
|
|
size_t numStrings);
|
|
|
|
char *
|
|
xmlSlurpFile(const char *path, size_t *size);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* __XML_FUZZERCOMMON_H__ */
|
|
|