Coverage Report

Created: 2025-07-18 06:46

/src/openssh/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
819
{
13
819
  char *cp = (char *)malloc(size + 1);
14
819
  struct sshsigopt *opts = NULL;
15
16
819
  if (cp == NULL)
17
0
    goto out;
18
819
  memcpy(cp, data, size);
19
819
  cp[size] = '\0';
20
819
  if ((opts = sshsigopt_parse(cp, "libfuzzer", 0, NULL)) == NULL)
21
642
    goto out;
22
23
819
 out:
24
819
  free(cp);
25
819
  sshsigopt_free(opts);
26
819
  return 0;
27
819
}
28
29
} // extern "C"