python-tabulate: avoid any exceptions from json (#8717)

To avoid e.g. recursion errors as well, since this is irrelevant to
python-tabulate.

Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=49986
This commit is contained in:
DavidKorczynski 2022-10-07 23:15:44 +01:00 committed by GitHub
parent fb1f5078cf
commit 12054aa275
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -29,7 +29,7 @@ def TestOneInput(data):
# Create random dictionary # Create random dictionary
try: try:
fuzzed_dict = json.loads(fdp.ConsumeString(sys.maxsize)) fuzzed_dict = json.loads(fdp.ConsumeString(sys.maxsize))
except json.JSONDecodeError: except:
return return
if type(fuzzed_dict) is not dict: if type(fuzzed_dict) is not dict:
return return