Coverage Report

Created: 2026-02-14 07:20

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/openssl33/fuzz/v3name.c
Line
Count
Source
1
/*
2
 * Copyright 2012-2023 The OpenSSL Project Authors. All Rights Reserved.
3
 *
4
 * Licensed under the Apache License 2.0 (the "License").  You may not use
5
 * this file except in compliance with the License.  You can obtain a copy
6
 * in the file LICENSE in the source distribution or at
7
 * https://www.openssl.org/source/license.html
8
 */
9
10
#include <string.h>
11
#include <openssl/e_os2.h>
12
#include <openssl/x509.h>
13
#include <openssl/x509v3.h>
14
#include "internal/nelem.h"
15
#include "fuzzer.h"
16
17
int FuzzerInitialize(int *argc, char ***argv)
18
216
{
19
216
    return 1;
20
216
}
21
22
int FuzzerTestOneInput(const uint8_t *data, size_t size)
23
13.0k
{
24
13.0k
    GENERAL_NAME *namesa;
25
13.0k
    GENERAL_NAME *namesb;
26
27
13.0k
    const unsigned char *derp = data;
28
    /*
29
     * We create two versions of each GENERAL_NAME so that we ensure when
30
     * we compare them they are always different pointers.
31
     */
32
13.0k
    namesa = d2i_GENERAL_NAME(NULL, &derp, size);
33
13.0k
    derp = data;
34
13.0k
    namesb = d2i_GENERAL_NAME(NULL, &derp, size);
35
13.0k
    GENERAL_NAME_cmp(namesa, namesb);
36
13.0k
    if (namesa != NULL)
37
2.28k
        GENERAL_NAME_free(namesa);
38
13.0k
    if (namesb != NULL)
39
2.28k
        GENERAL_NAME_free(namesb);
40
13.0k
    return 0;
41
13.0k
}
42
43
void FuzzerCleanup(void)
44
0
{
45
0
}