Merge pull request #5688 from Google-Autofuzz/new_atheris

This commit is contained in:
Hugo van Kemenade 2021-09-13 09:27:57 +03:00 committed by GitHub
commit 63c5faa0f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 12 deletions

View File

@ -14,10 +14,13 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import sys
import atheris_no_libfuzzer as atheris import atheris
import fuzzers
with atheris.instrument_imports():
import sys
import fuzzers
def TestOneInput(data): def TestOneInput(data):
@ -26,13 +29,12 @@ def TestOneInput(data):
except Exception: except Exception:
# We're catching all exceptions because Pillow's exceptions are # We're catching all exceptions because Pillow's exceptions are
# directly inheriting from Exception. # directly inheriting from Exception.
return pass
return
def main(): def main():
fuzzers.enable_decompressionbomb_error() fuzzers.enable_decompressionbomb_error()
atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True) atheris.Setup(sys.argv, TestOneInput)
atheris.Fuzz() atheris.Fuzz()
fuzzers.disable_decompressionbomb_error() fuzzers.disable_decompressionbomb_error()

View File

@ -14,10 +14,13 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import sys
import atheris_no_libfuzzer as atheris import atheris
import fuzzers
with atheris.instrument_imports():
import sys
import fuzzers
def TestOneInput(data): def TestOneInput(data):
@ -26,13 +29,12 @@ def TestOneInput(data):
except Exception: except Exception:
# We're catching all exceptions because Pillow's exceptions are # We're catching all exceptions because Pillow's exceptions are
# directly inheriting from Exception. # directly inheriting from Exception.
return pass
return
def main(): def main():
fuzzers.enable_decompressionbomb_error() fuzzers.enable_decompressionbomb_error()
atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True) atheris.Setup(sys.argv, TestOneInput)
atheris.Fuzz() atheris.Fuzz()
fuzzers.disable_decompressionbomb_error() fuzzers.disable_decompressionbomb_error()