Files
weee/tests/elfio_fuzzer.cpp
T
iris a67f311330 Squashed 'external/ELFIO/' content from commit 94f7706
git-subtree-dir: external/ELFIO
git-subtree-split: 94f7706b5325b2ad9872e4481278278592cf86c9
2026-05-11 11:41:03 +02:00

33 lines
723 B
C++

#include <string>
#include <sstream>
#include <elfio/elfio.hpp>
#include <elfio/elfio_dump.hpp>
using namespace ELFIO;
extern "C" int LLVMFuzzerTestOneInput( const std::uint8_t* Data, size_t Size )
{
std::string str( (const char*)Data, Size );
std::istringstream ss( str );
std::ostringstream oss;
elfio elf;
if ( !elf.load( ss ) ) {
return 0;
}
dump::header( oss, elf );
dump::section_headers( oss, elf );
dump::segment_headers( oss, elf );
dump::symbol_tables( oss, elf );
dump::notes( oss, elf );
dump::modinfo( oss, elf );
dump::dynamic_tags( oss, elf );
dump::section_datas( oss, elf );
dump::segment_datas( oss, elf );
return 0;
}