| 1 |
|
| 2 |
|
| 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 |
#include <rabbitmq-c/framing.h> |
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
extern int LLVMFuzzerTestOneInput(const char *data, size_t size) { |
| 19 |
|
| 20 |
int unused_result; |
| 21 |
amqp_pool_t pool; |
| 22 |
uint16_t class_id; |
| 23 |
|
| 24 |
if (size < 2) { |
| 25 |
return 0; |
| 26 |
} |
| 27 |
|
| 28 |
class_id = ((uint16_t)(uint8_t)data[0] << 8) | |
| 29 |
((uint16_t)(uint8_t)data[1]); |
| 30 |
|
| 31 |
init_amqp_pool(&pool, 4096); |
| 32 |
{ |
| 33 |
void *decoded = NULL; |
| 34 |
amqp_bytes_t encoded; |
| 35 |
encoded.len = size - 2; |
| 36 |
encoded.bytes = (void *)(data + 2); |
| 37 |
|
| 38 |
unused_result = amqp_decode_properties(class_id, &pool, encoded, &decoded); |
| 39 |
} |
| 40 |
empty_amqp_pool(&pool); |
| 41 |
return 0; |
| 42 |
} |