Coverage Report

Created: 2024-09-08 07:48

/src/fuzz_xml.c
Line
Count
Source (jump to first uncovered line)
1
/* Copyright 2022 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
#include "sdp-xml.h"
23
24
0
void empty_func(void *d, const char *s) {
25
0
  return;
26
0
}
27
28
145
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
29
145
  sdp_record_t *rec;
30
145
  rec = sdp_xml_parse_record(data, size);
31
145
  if (rec != NULL) {
32
64
    convert_sdp_record_to_xml(rec, 0, empty_func);
33
64
    sdp_record_free(rec);
34
64
  }
35
36
145
  return 0;
37
145
}