olm/fuzzers/fuzz_unpickle_session.cpp

17 lines
465 B
C++
Raw Normal View History

#include "olm/session.hh"
#include "fuzzing.hh"
int main(int argc, const char *argv[]) {
int pickle_fd = STDIN_FILENO;
uint8_t * pickle_buffer;
ssize_t pickle_length = check_errno(
"Error reading pickle file", read_file(pickle_fd, &pickle_buffer)
);
olm::Session * session = new olm::Session;
unpickle(pickle_buffer, pickle_buffer + pickle_length, *session);
free(pickle_buffer);
delete session;
2021-07-08 16:23:55 +02:00
return EXIT_SUCCESS;
}