Coverage Report

Created: 2025-07-01 07:01

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