Coverage Report

Created: 2023-03-26 06:02

/src/librabbitmq/fuzz/fuzz_table.c
Line
Count
Source
1
// Copyright 2007 - 2022, Alan Antonuk and the rabbitmq-c contributors.
2
// SPDX-License-Identifier: mit
3
4
#include <errno.h>
5
#include <inttypes.h>
6
#include <math.h>
7
#include <stdarg.h>
8
#include <stdio.h>
9
#include <stdlib.h>
10
#include <string.h>
11
12
#include <rabbitmq-c/amqp.h>
13
14
1.05k
extern int LLVMFuzzerTestOneInput(const char *data, size_t size) {
15
16
1.05k
  int unused_result;
17
1.05k
  amqp_pool_t pool;
18
19
1.05k
  init_amqp_pool(&pool, 4096);
20
1.05k
  {
21
1.05k
    amqp_table_t decoded;
22
1.05k
    size_t decoding_offset = 0;
23
1.05k
    amqp_bytes_t decoding_bytes;
24
1.05k
    decoding_bytes.len = size;
25
1.05k
    decoding_bytes.bytes = (uint8_t *)data;
26
27
1.05k
    unused_result =
28
1.05k
        amqp_decode_table(decoding_bytes, &pool, &decoded, &decoding_offset);
29
1.05k
  }
30
1.05k
  empty_amqp_pool(&pool);
31
1.05k
  return 0;
32
1.05k
}