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
814
814
return true ;
815
815
}
816
816
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
-
829
817
// ! prevent reading beyond a certain position
830
818
// ! no argument removes the limit
831
819
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)
31
31
if (opt_buffered_file && fuzzed_file != nullptr ) {
32
32
bool setpos_fail = false ;
33
33
while (fuzzed_data_provider.ConsumeBool ()) {
34
- switch (fuzzed_data_provider.ConsumeIntegralInRange <int >(0 , 5 )) {
34
+ switch (fuzzed_data_provider.ConsumeIntegralInRange <int >(0 , 4 )) {
35
35
case 0 : {
36
36
std::array<uint8_t , 4096 > arr{};
37
37
try {
@@ -41,20 +41,16 @@ void test_one_input(const std::vector<uint8_t>& buffer)
41
41
break ;
42
42
}
43
43
case 1 : {
44
- opt_buffered_file->Seek (fuzzed_data_provider.ConsumeIntegralInRange <uint64_t >(0 , 4096 ));
45
- break ;
46
- }
47
- case 2 : {
48
44
opt_buffered_file->SetLimit (fuzzed_data_provider.ConsumeIntegralInRange <uint64_t >(0 , 4096 ));
49
45
break ;
50
46
}
51
- case 3 : {
47
+ case 2 : {
52
48
if (!opt_buffered_file->SetPos (fuzzed_data_provider.ConsumeIntegralInRange <uint64_t >(0 , 4096 ))) {
53
49
setpos_fail = true ;
54
50
}
55
51
break ;
56
52
}
57
- case 4 : {
53
+ case 3 : {
58
54
if (setpos_fail) {
59
55
// Calling FindByte(...) after a failed SetPos(...) call may result in an infinite loop.
60
56
break ;
@@ -65,7 +61,7 @@ void test_one_input(const std::vector<uint8_t>& buffer)
65
61
}
66
62
break ;
67
63
}
68
- case 5 : {
64
+ case 4 : {
69
65
ReadFromStream (fuzzed_data_provider, *opt_buffered_file);
70
66
break ;
71
67
}
You can’t perform that action at this time.
0 commit comments