diff --git a/fuzzers/data_builder.h b/fuzzers/data_builder.h index b6ec22fd45..5abb98c4fd 100644 --- a/fuzzers/data_builder.h +++ b/fuzzers/data_builder.h @@ -34,7 +34,8 @@ class DataBuilder { explicit DataBuilder(const uint8_t* data, size_t size) : generator_(data, size) {} - ~DataBuilder() {} + ~DataBuilder() = default; + DataBuilder(DataBuilder&&) = default; /// Generate pseudo-random data of a specific type /// @tparam T - type of data to produce @@ -85,6 +86,10 @@ class DataBuilder { private: RandomGenerator generator_; + // Disallow copy & assign + DataBuilder(const DataBuilder&) = delete; + DataBuilder& operator=(const DataBuilder&) = delete; + /// Get N bytes of pseudo-random data /// @param out - pointer to location to save data /// @param n - number of bytes to get diff --git a/fuzzers/random_generator.h b/fuzzers/random_generator.h index c7b7afce74..5a61baed4f 100644 --- a/fuzzers/random_generator.h +++ b/fuzzers/random_generator.h @@ -33,6 +33,9 @@ class RandomGenerator { /// @param size - size of data buffer explicit RandomGenerator(const uint8_t* data, size_t size); + ~RandomGenerator() = default; + RandomGenerator(RandomGenerator&&) = default; + /// Get uint32_t value from uniform distribution. /// @param lower - lower bound of integer generated /// @param upper - upper bound of integer generated @@ -98,6 +101,10 @@ class RandomGenerator { private: std::mt19937_64 engine_; + // Disallow copy & assign + RandomGenerator(const RandomGenerator&) = delete; + RandomGenerator& operator=(const RandomGenerator&) = delete; + }; // class RandomGenerator } // namespace fuzzers