2020-04-01 10:22:23 -05:00
|
|
|
#include <iostream>
|
|
|
|
|
2021-03-29 10:38:42 -05:00
|
|
|
#include "config.h"
|
|
|
|
|
2020-04-01 10:22:23 -05:00
|
|
|
#include "Admin.hpp"
|
|
|
|
|
|
|
|
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
|
|
|
|
{
|
|
|
|
Admin& admin = Admin::instance();
|
|
|
|
auto handler = std::make_shared<AdminSocketHandler>(&admin);
|
|
|
|
|
|
|
|
std::string input(reinterpret_cast<const char*>(data), size);
|
|
|
|
std::stringstream ss(input);
|
|
|
|
std::string line;
|
|
|
|
while (std::getline(ss, line, '\n'))
|
|
|
|
{
|
|
|
|
std::vector<char> lineVector(line.data(), line.data() + line.size());
|
|
|
|
handler->handleMessage(lineVector);
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|