Coverage Report

Created: 2026-08-13 07:07

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/bind9/fuzz/dns_name_fromtext_target.c
Line
Count
Source
1
/*
2
 * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
3
 *
4
 * SPDX-License-Identifier: MPL-2.0
5
 *
6
 * This Source Code Form is subject to the terms of the Mozilla Public
7
 * License, v. 2.0. If a copy of the MPL was not distributed with this
8
 * file, you can obtain one at https://mozilla.org/MPL/2.0/.
9
 *
10
 * See the COPYRIGHT file distributed with this work for additional
11
 * information regarding copyright ownership.
12
 */
13
14
#include <stddef.h>
15
#include <stdint.h>
16
17
#include <isc/buffer.h>
18
#include <isc/util.h>
19
20
#include <dns/fixedname.h>
21
#include <dns/name.h>
22
23
#include "fuzz.h"
24
25
bool debug = false;
26
27
int
28
18
LLVMFuzzerInitialize(int *argc ISC_ATTR_UNUSED, char ***argv ISC_ATTR_UNUSED) {
29
18
  return 0;
30
18
}
31
32
int
33
285
LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
34
285
  isc_buffer_t buf;
35
285
  isc_result_t result;
36
285
  dns_fixedname_t origin;
37
38
285
  dns_fixedname_init(&origin);
39
40
285
  isc_buffer_constinit(&buf, data, size);
41
285
  isc_buffer_add(&buf, size);
42
285
  isc_buffer_setactive(&buf, size);
43
44
285
  result = dns_name_fromtext(dns_fixedname_name(&origin), &buf,
45
285
           dns_rootname, 0);
46
285
  if (debug) {
47
    fprintf(stderr, "dns_name_fromtext: %s\n",
48
0
      isc_result_totext(result));
49
0
  }
50
285
  return 0;
51
285
}