pyyaml: catch recursion exceptions (#8227)

Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50061
This commit is contained in:
DavidKorczynski 2022-08-12 09:51:01 +01:00 committed by GitHub
parent 65e2d97a6a
commit de098f51a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -28,6 +28,8 @@ def TestOneInput(input_bytes):
context = yaml.load(input_bytes, Loader=yaml.FullLoader)
except yaml.YAMLError:
pass
except RecursionError:
pass
def main():
atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)

View File

@ -28,6 +28,8 @@ def TestOneInput(data):
stream.forward()
except yaml.reader.ReaderError:
None
except RecursionError:
pass
return