fuzz_decode_message.cpp 476 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "olm/message.hh"
#include "fuzzing.hh"

int main(int argc, const char *argv[]) {
    int message_fd = STDIN_FILENO;
    uint8_t * message_buffer;
    ssize_t message_length = check_errno(
        "Error reading message file", read_file(message_fd, &message_buffer)
    );
    olm::MessageReader * reader = new olm::MessageReader;
    decode_message(*reader, message_buffer, message_length, 8);
    free(message_buffer);
    delete reader;
14
15

    return EXIT_SUCCESS;
16
}