/
githubmirror
/
xmlsec
Обзор
Документация
Войти
/
githubmirror
/
xmlsec
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
apps/oss-fuzz/xmlsec_target.c
25 строк
713 B
lsh123
Move fuzzers from tests/ to apps/ folder and add to the build (#1209)
22 июн 2026, 21:19
Не верифицирован
22 июн 2026, 21:19
80f54b4
Код
Авторство
О чём код?
#include <stdint.h> #include <stddef.h> #include <xmlsec/buffer.h> #include <xmlsec/parser.h> int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size); static void ignore(void* ctx, const char* msg, ...) { /* Error handler to avoid spam of error messages from libxml parser. */ (void)ctx; (void)msg; } int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { xmlSetGenericErrorFunc(NULL, &ignore); xmlSecBufferPtr buf = xmlSecBufferCreate(size); xmlSecBufferSetData(buf, data, size); xmlDocPtr doc = xmlSecParseMemory(xmlSecBufferGetData(buf), xmlSecBufferGetSize(buf), 0); if (doc != NULL) xmlFreeDoc(doc); xmlSecBufferDestroy(buf); return 0; }