Coverage Report

Created: 2025-12-05 07:02

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/miniz/tests/checksum_fuzzer.c
Line
Count
Source
1
/* Derived from zlib fuzzers at http://github.com/google/oss-fuzz/tree/master/projects/zlib,
2
 * see ossfuzz.sh for full license text.
3
 */
4
5
#include <stddef.h>
6
#include <stdint.h>
7
#include <inttypes.h>
8
9
#include "miniz.h"
10
11
static const size_t kMaxSize = 1024 * 1024;
12
13
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataLen)
14
105
{
15
    /* Discard inputs larger than 1Mb. */
16
105
    if (dataLen < 1 || dataLen > kMaxSize)
17
0
        return 0;
18
19
105
    uint32_t crc = crc32(0L, NULL, 0);
20
105
    uint32_t adler = adler32(0L, NULL, 0);
21
22
105
    crc = crc32(crc, data, (uint32_t)dataLen);
23
105
    adler = adler32(adler, data, (uint32_t)dataLen);
24
25
105
    return 0;
26
105
}