Coverage Report

Created: 2024-06-18 06:23

/src/hpn-ssh/regress/misc/fuzz-harness/sshsigopt_fuzz.cc
Line
Count
Source (jump to first uncovered line)
1
#include <stddef.h>
2
#include <stdio.h>
3
#include <stdint.h>
4
#include <string.h>
5
#include <stdlib.h>
6
7
extern "C" {
8
9
#include "sshsig.h"
10
11
int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
12
809
{
13
809
  char *cp = (char *)malloc(size + 1);
14
809
  struct sshsigopt *opts = NULL;
15
16
809
  if (cp == NULL)
17
0
    goto out;
18
809
  memcpy(cp, data, size);
19
809
  cp[size] = '\0';
20
809
  if ((opts = sshsigopt_parse(cp, "libfuzzer", 0, NULL)) == NULL)
21
632
    goto out;
22
23
809
 out:
24
809
  free(cp);
25
809
  sshsigopt_free(opts);
26
809
  return 0;
27
809
}
28
29
} // extern "C"