aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfreenancial <freenancial@protonmail.com>2020-07-21 15:21:27 -0700
committerfreenancial <freenancial@protonmail.com>2020-07-21 15:23:49 -0700
commitc8992e89594a54edf283e4916f794475070b5114 (patch)
tree4c35deb260a442214dd87fae0e156fadb1002fd0
parent476436b2dec254bb988f8c7a6cbec1d7bb7cecfd (diff)
test: Fix fuzzer compilation on macOS
fixes #19557
-rw-r--r--src/test/fuzz/util.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/fuzz/util.h b/src/test/fuzz/util.h
index 148610c04d..9f9552edb9 100644
--- a/src/test/fuzz/util.h
+++ b/src/test/fuzz/util.h
@@ -332,7 +332,7 @@ public:
return 0;
}
std::memcpy(buf, random_bytes.data(), random_bytes.size());
- if (AdditionOverflow((uint64_t)fuzzed_file->m_offset, random_bytes.size())) {
+ if (AdditionOverflow(fuzzed_file->m_offset, (int64_t)random_bytes.size())) {
return fuzzed_file->m_fuzzed_data_provider.ConsumeBool() ? 0 : -1;
}
fuzzed_file->m_offset += random_bytes.size();
@@ -343,7 +343,7 @@ public:
{
FuzzedFileProvider* fuzzed_file = (FuzzedFileProvider*)cookie;
const ssize_t n = fuzzed_file->m_fuzzed_data_provider.ConsumeIntegralInRange<ssize_t>(0, size);
- if (AdditionOverflow(fuzzed_file->m_offset, n)) {
+ if (AdditionOverflow(fuzzed_file->m_offset, (int64_t)n)) {
return fuzzed_file->m_fuzzed_data_provider.ConsumeBool() ? 0 : -1;
}
fuzzed_file->m_offset += n;