Coverage Report

Created: 2025-07-11 07:00

/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.02k
extern int LLVMFuzzerTestOneInput(const char *data, size_t size) {
15
16
1.02k
  int unused_result;
17
1.02k
  amqp_pool_t pool;
18
19
1.02k
  init_amqp_pool(&pool, 4096);
20
1.02k
  {
21
1.02k
    amqp_table_t decoded;
22
1.02k
    size_t decoding_offset = 0;
23
1.02k
    amqp_bytes_t decoding_bytes;
24
1.02k
    decoding_bytes.len = size;
25
1.02k
    decoding_bytes.bytes = (uint8_t *)data;
26
27
1.02k
    unused_result =
28
1.02k
        amqp_decode_table(decoding_bytes, &pool, &decoded, &decoding_offset);
29
1.02k
  }
30
1.02k
  empty_amqp_pool(&pool);
31
1.02k
  return 0;
32
1.02k
}