Coverage Report

Created: 2024-05-20 06:10

/src/fuzz_xml.c
Line
Count
Source
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
292k
void empty_func(void *d, const char *s) {
25
292k
  return;
26
292k
}
27
28
284
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
29
284
  sdp_record_t *rec;
30
284
  rec = sdp_xml_parse_record(data, size);
31
284
  if (rec != NULL) {
32
174
    convert_sdp_record_to_xml(rec, 0, empty_func);
33
174
    sdp_record_free(rec);
34
174
  }
35
36
284
  return 0;
37
284
}