Skip to content

Commit 9d48143

Browse files
author
Julien Voisin
committed
Improve the fuzzer wrt. the current atheris version
1 parent d50052a commit 9d48143

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

Tests/oss-fuzz/fuzz_font.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
import sys
1817

19-
import atheris_no_libfuzzer as atheris
20-
import fuzzers
18+
import atheris
19+
with atheris.instrument_imports():
20+
import sys
21+
import fuzzers
2122

2223

2324
def TestOneInput(data):
@@ -26,13 +27,12 @@ def TestOneInput(data):
2627
except Exception:
2728
# We're catching all exceptions because Pillow's exceptions are
2829
# directly inheriting from Exception.
29-
return
30-
return
30+
pass
3131

3232

3333
def main():
3434
fuzzers.enable_decompressionbomb_error()
35-
atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)
35+
atheris.Setup(sys.argv, TestOneInput)
3636
atheris.Fuzz()
3737
fuzzers.disable_decompressionbomb_error()
3838

Tests/oss-fuzz/fuzz_pillow.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
import sys
1817

19-
import atheris_no_libfuzzer as atheris
20-
import fuzzers
18+
import atheris
19+
with atheris.instrument_imports():
20+
import sys
21+
import fuzzers
2122

2223

2324
def TestOneInput(data):
@@ -26,13 +27,12 @@ def TestOneInput(data):
2627
except Exception:
2728
# We're catching all exceptions because Pillow's exceptions are
2829
# directly inheriting from Exception.
29-
return
30-
return
30+
pass
3131

3232

3333
def main():
3434
fuzzers.enable_decompressionbomb_error()
35-
atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)
35+
atheris.Setup(sys.argv, TestOneInput)
3636
atheris.Fuzz()
3737
fuzzers.disable_decompressionbomb_error()
3838

0 commit comments

Comments
 (0)