summaryrefslogtreecommitdiffstats
path: root/contrib/libs/libfuzzer/include/fuzzer/FuzzedDataProvider.h
diff options
context:
space:
mode:
authorrobot-piglet <[email protected]>2024-12-06 02:25:02 +0300
committerrobot-piglet <[email protected]>2024-12-06 02:36:54 +0300
commita3f34f7ae0f6a0859b79c398b6bddf55071b4171 (patch)
treef1de4ef4fee0f6a85c83d79fdf666cdadac75259 /contrib/libs/libfuzzer/include/fuzzer/FuzzedDataProvider.h
parent791c95291cdeb78d59b058c8575f99cef4a94c86 (diff)
Intermediate changes
commit_hash:06212cb2bd676fc129fca8d6996e5c769e5bb047
Diffstat (limited to 'contrib/libs/libfuzzer/include/fuzzer/FuzzedDataProvider.h')
-rw-r--r--contrib/libs/libfuzzer/include/fuzzer/FuzzedDataProvider.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/libs/libfuzzer/include/fuzzer/FuzzedDataProvider.h b/contrib/libs/libfuzzer/include/fuzzer/FuzzedDataProvider.h
index 71cb427ec4a..5903ed83791 100644
--- a/contrib/libs/libfuzzer/include/fuzzer/FuzzedDataProvider.h
+++ b/contrib/libs/libfuzzer/include/fuzzer/FuzzedDataProvider.h
@@ -158,7 +158,7 @@ FuzzedDataProvider::ConsumeRandomLengthString(size_t max_length) {
// picking its contents.
std::string result;
- // Reserve the anticipated capaticity to prevent several reallocations.
+ // Reserve the anticipated capacity to prevent several reallocations.
result.reserve(std::min(max_length, remaining_bytes_));
for (size_t i = 0; i < max_length && remaining_bytes_ != 0; ++i) {
char next = ConvertUnsignedToSigned<char>(data_ptr_[0]);
@@ -209,7 +209,7 @@ T FuzzedDataProvider::ConsumeIntegralInRange(T min, T max) {
abort();
// Use the biggest type possible to hold the range and the result.
- uint64_t range = static_cast<uint64_t>(max) - min;
+ uint64_t range = static_cast<uint64_t>(max) - static_cast<uint64_t>(min);
uint64_t result = 0;
size_t offset = 0;
@@ -230,7 +230,7 @@ T FuzzedDataProvider::ConsumeIntegralInRange(T min, T max) {
if (range != std::numeric_limits<decltype(range)>::max())
result = result % (range + 1);
- return static_cast<T>(min + result);
+ return static_cast<T>(static_cast<uint64_t>(min) + result);
}
// Returns a floating point value in the range [Type's lowest, Type's max] by