Coverage Report

Created: 2025-12-04 06:33

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/openssl36/fuzz/v3name.c
Line
Count
Source
1
/*
2
 * Copyright 2012-2025 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
242
{
19
242
    return 1;
20
242
}
21
22
14.8k
int FuzzerTestOneInput(const uint8_t* data, size_t size){
23
14.8k
    GENERAL_NAME *namesa;
24
14.8k
    GENERAL_NAME *namesb;
25
26
14.8k
    const unsigned char *derp = data;
27
    /*
28
     * We create two versions of each GENERAL_NAME so that we ensure when
29
     * we compare them they are always different pointers.
30
     */
31
14.8k
    namesa = d2i_GENERAL_NAME(NULL, &derp, (long)size);
32
14.8k
    derp = data;
33
14.8k
    namesb = d2i_GENERAL_NAME(NULL, &derp, (long)size);
34
14.8k
    GENERAL_NAME_cmp(namesa, namesb);
35
14.8k
    if (namesa != NULL)
36
2.73k
        GENERAL_NAME_free(namesa);
37
14.8k
    if (namesb != NULL)
38
2.73k
        GENERAL_NAME_free(namesb);
39
14.8k
    return 0;
40
14.8k
}
41
42
void FuzzerCleanup(void)
43
0
{
44
0
}