Coverage Report

Created: 2024-02-29 06:05

/src/strongswan/fuzz/fuzz_ids.c
Line
Count
Source
1
/*
2
 * Copyright (C) 2018 Tobias Brunner
3
 *
4
 * Copyright (C) secunet Security Networks AG
5
 *
6
 * This program is free software; you can redistribute it and/or modify it
7
 * under the terms of the GNU General Public License as published by the
8
 * Free Software Foundation; either version 2 of the License, or (at your
9
 * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
10
 *
11
 * This program is distributed in the hope that it will be useful, but
12
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14
 * for more details.
15
 */
16
17
#include <library.h>
18
#include <utils/debug.h>
19
20
int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len)
21
2.17k
{
22
2.17k
  identification_t *id;
23
2.17k
  chunk_t chunk;
24
25
2.17k
  dbg_default_set_level(-1);
26
2.17k
  library_init(NULL, "fuzz_ids");
27
28
2.17k
  chunk = chunk_create((u_char*)buf, len);
29
2.17k
  id = identification_create_from_data(chunk);
30
2.17k
  DESTROY_IF(id);
31
32
2.17k
  library_deinit();
33
2.17k
  return 0;
34
2.17k
}