Coverage Report

Created: 2024-05-20 06:23

/src/nss/fuzz/shared.cc
Line
Count
Source (jump to first uncovered line)
1
/* This Source Code Form is subject to the terms of the Mozilla Public
2
 * License, v. 2.0. If a copy of the MPL was not distributed with this
3
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5
#include "shared.h"
6
7
size_t CustomMutate(Mutators mutators, uint8_t *data, size_t size,
8
0
                    size_t max_size, unsigned int seed) {
9
0
  std::mt19937 rng(seed);
10
0
  static std::bernoulli_distribution bdist;
11
12
0
  if (bdist(rng)) {
13
0
    std::uniform_int_distribution<size_t> idist(0, mutators.size() - 1);
14
0
    return mutators.at(idist(rng))(data, size, max_size, seed);
15
0
  }
16
17
0
  return LLVMFuzzerMutate(data, size, max_size);
18
0
}