Coverage Report

Created: 2026-01-13 07:08

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/mosquitto/fuzzing/libcommon/libcommon_fuzz_topic_matching.cpp
Line
Count
Source
1
#include "src/libfuzzer/libfuzzer_macro.h"
2
3
#include "libcommon_fuzz_topic_matching.pb.h"
4
#include "mosquitto.h"
5
6
DEFINE_PROTO_FUZZER(const fuzz_topic_matches_sub::FuzzerInput& fuzzer_input)
7
861
{
8
861
  bool result;
9
861
  const char *string1 = fuzzer_input.string1().c_str();
10
861
  const char *string2 = fuzzer_input.string2().c_str();
11
861
  const char *username = nullptr;
12
861
  const char *clientid = nullptr;
13
14
861
  if(fuzzer_input.has_username()){
15
37
    username = fuzzer_input.username().c_str();
16
37
  }
17
861
  if(fuzzer_input.has_clientid()){
18
95
    clientid = fuzzer_input.clientid().c_str();
19
95
  }
20
21
    //targeted_function_1(fuzzer_input.arg1(), fuzzer_input.arg2(), fuzzer_input.arg3());
22
861
  mosquitto_topic_matches_sub(string1, string2, &result);
23
861
  mosquitto_topic_matches_sub2(string1, strlen(string1), string2, strlen(string2), &result);
24
861
  mosquitto_topic_matches_sub_with_pattern(string1, string2, clientid, username, &result);
25
26
861
  mosquitto_sub_matches_acl(string1, string2, &result);
27
861
  mosquitto_sub_matches_acl_with_pattern(string1, string2, clientid, username, &result);
28
861
}