fuzz_unpickle_session.cpp 465 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
#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;
14
15

    return EXIT_SUCCESS;
16
}