diff --git a/src/streams.h b/src/streams.h --- a/src/streams.h +++ b/src/streams.h @@ -815,20 +815,6 @@ return true; } - bool Seek(uint64_t nPos) { - long nLongPos = nPos; - if (nPos != (uint64_t)nLongPos) { - return false; - } - if (fseek(src, nLongPos, SEEK_SET)) { - return false; - } - nLongPos = ftell(src); - nSrcPos = nLongPos; - nReadPos = nLongPos; - return true; - } - //! Prevent reading beyond a certain position. No argument removes the //! limit. bool SetLimit(uint64_t nPos = std::numeric_limits::max()) { diff --git a/src/test/fuzz/buffered_file.cpp b/src/test/fuzz/buffered_file.cpp --- a/src/test/fuzz/buffered_file.cpp +++ b/src/test/fuzz/buffered_file.cpp @@ -35,7 +35,7 @@ if (opt_buffered_file && fuzzed_file != nullptr) { bool setpos_fail = false; while (fuzzed_data_provider.ConsumeBool()) { - switch (fuzzed_data_provider.ConsumeIntegralInRange(0, 5)) { + switch (fuzzed_data_provider.ConsumeIntegralInRange(0, 4)) { case 0: { std::array arr{}; try { @@ -48,18 +48,12 @@ break; } case 1: { - opt_buffered_file->Seek( - fuzzed_data_provider.ConsumeIntegralInRange( - 0, 4096)); - break; - } - case 2: { opt_buffered_file->SetLimit( fuzzed_data_provider.ConsumeIntegralInRange( 0, 4096)); break; } - case 3: { + case 2: { if (!opt_buffered_file->SetPos( fuzzed_data_provider .ConsumeIntegralInRange(0, 4096))) { @@ -67,7 +61,7 @@ } break; } - case 4: { + case 3: { if (setpos_fail) { // Calling FindByte(...) after a failed SetPos(...) call // may result in an infinite loop. @@ -80,7 +74,7 @@ } break; } - case 5: { + case 4: { ReadFromStream(fuzzed_data_provider, *opt_buffered_file); break; }