Coverage Report

Created: 2025-11-16 07:09

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/fuzz_sdp.c
Line
Count
Source
1
/* Copyright 2021 Google LLC
2
Licensed under the Apache License, Version 2.0 (the "License");
3
you may not use this file except in compliance with the License.
4
You may obtain a copy of the License at
5
      http://www.apache.org/licenses/LICENSE-2.0
6
Unless required by applicable law or agreed to in writing, software
7
distributed under the License is distributed on an "AS IS" BASIS,
8
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
See the License for the specific language governing permissions and
10
limitations under the License.
11
*/
12
#include <config.h>
13
14
#include <stdint.h>
15
#include <string.h>
16
#include <stdlib.h>
17
#include <syslog.h>
18
19
#include "bluetooth.h"
20
#include "sdp.h"
21
#include "sdp_lib.h"
22
23
85
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
24
25
  /* Target sdp_extract_pdu */
26
85
  int scanned = 0;
27
85
  sdp_record_t *out = NULL;
28
85
  openlog("fuzz_sdp", LOG_PERROR, LOG_LOCAL0);
29
85
  out = sdp_extract_pdu(data, size, &scanned);
30
85
  if (out) {
31
85
    sdp_record_t *copy = sdp_copy_record(out);
32
85
    if (copy) {
33
85
      sdp_record_free(copy);
34
85
    }
35
85
    sdp_record_free(out);
36
85
  }
37
85
  closelog();
38
39
85
  return 0;
40
85
}