File tree Expand file tree Collapse file tree 2 files changed +4
-20
lines changed
Expand file tree Collapse file tree 2 files changed +4
-20
lines changed Original file line number Diff line number Diff line change @@ -814,18 +814,6 @@ class CBufferedFile
814814 return true ;
815815 }
816816
817- bool Seek (uint64_t nPos) {
818- long nLongPos = nPos;
819- if (nPos != (uint64_t )nLongPos)
820- return false ;
821- if (fseek (src, nLongPos, SEEK_SET))
822- return false ;
823- nLongPos = ftell (src);
824- nSrcPos = nLongPos;
825- nReadPos = nLongPos;
826- return true ;
827- }
828-
829817 // ! prevent reading beyond a certain position
830818 // ! no argument removes the limit
831819 bool SetLimit (uint64_t nPos = std::numeric_limits<uint64_t >::max()) {
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ void test_one_input(const std::vector<uint8_t>& buffer)
3131 if (opt_buffered_file && fuzzed_file != nullptr ) {
3232 bool setpos_fail = false ;
3333 while (fuzzed_data_provider.ConsumeBool ()) {
34- switch (fuzzed_data_provider.ConsumeIntegralInRange <int >(0 , 5 )) {
34+ switch (fuzzed_data_provider.ConsumeIntegralInRange <int >(0 , 4 )) {
3535 case 0 : {
3636 std::array<uint8_t , 4096 > arr{};
3737 try {
@@ -41,20 +41,16 @@ void test_one_input(const std::vector<uint8_t>& buffer)
4141 break ;
4242 }
4343 case 1 : {
44- opt_buffered_file->Seek (fuzzed_data_provider.ConsumeIntegralInRange <uint64_t >(0 , 4096 ));
45- break ;
46- }
47- case 2 : {
4844 opt_buffered_file->SetLimit (fuzzed_data_provider.ConsumeIntegralInRange <uint64_t >(0 , 4096 ));
4945 break ;
5046 }
51- case 3 : {
47+ case 2 : {
5248 if (!opt_buffered_file->SetPos (fuzzed_data_provider.ConsumeIntegralInRange <uint64_t >(0 , 4096 ))) {
5349 setpos_fail = true ;
5450 }
5551 break ;
5652 }
57- case 4 : {
53+ case 3 : {
5854 if (setpos_fail) {
5955 // Calling FindByte(...) after a failed SetPos(...) call may result in an infinite loop.
6056 break ;
@@ -65,7 +61,7 @@ void test_one_input(const std::vector<uint8_t>& buffer)
6561 }
6662 break ;
6763 }
68- case 5 : {
64+ case 4 : {
6965 ReadFromStream (fuzzed_data_provider, *opt_buffered_file);
7066 break ;
7167 }
You can’t perform that action at this time.
0 commit comments