Coverage Report

Created: 2025-10-10 06:45

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/FreeRDP/libfreerdp/common/test/TestFuzzCommonAssistanceParseFileBuffer.c
Line
Count
Source
1
#include <freerdp/assistance.h>
2
3
static int parse_file_buffer(const uint8_t* Data, size_t Size)
4
1.92k
{
5
1.92k
  static const char TEST_MSRC_INCIDENT_PASSWORD_TYPE2[] = "48BJQ853X3B4";
6
1.92k
  int status = -1;
7
1.92k
  rdpAssistanceFile* file = freerdp_assistance_file_new();
8
1.92k
  if (!file)
9
0
    return -1;
10
11
1.92k
  char* buf = calloc(Size + 1, sizeof(char));
12
1.92k
  if (buf == NULL)
13
0
    goto err;
14
1.92k
  memcpy(buf, Data, Size);
15
1.92k
  buf[Size] = '\0';
16
17
1.92k
  status = freerdp_assistance_parse_file_buffer(file, buf, Size + 1,
18
1.92k
                                                TEST_MSRC_INCIDENT_PASSWORD_TYPE2);
19
20
1.92k
err:
21
1.92k
  freerdp_assistance_file_free(file);
22
1.92k
  free(buf);
23
24
1.92k
  return status >= 0 ? TRUE : FALSE;
25
1.92k
}
26
27
int LLVMFuzzerTestOneInput(const uint8_t* Data, size_t Size)
28
1.92k
{
29
1.92k
  parse_file_buffer(Data, Size);
30
1.92k
  return 0;
31
1.92k
}