aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra/cifuzz
diff options
context:
space:
mode:
authorGravatar Leo Neat <lneat@google.com>2020-03-12 12:01:57 -0700
committerGravatar GitHub <noreply@github.com>2020-03-12 12:01:57 -0700
commitb0cd13e3bbe4ff91cf9e5de012898c055e70bac9 (patch)
tree78a948cbf5a965604c13dec490d8d656f3c9f85d /infra/cifuzz
parentda9cbde065a6ddc05433e35eaca3bce43427a9b7 (diff)
Affected fuzzer fix (#3494)
Fixing json decode error with affected fuzzer functionality.
Diffstat (limited to 'infra/cifuzz')
-rw-r--r--infra/cifuzz/cifuzz.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/infra/cifuzz/cifuzz.py b/infra/cifuzz/cifuzz.py
index bceb58c1..d0919291 100644
--- a/infra/cifuzz/cifuzz.py
+++ b/infra/cifuzz/cifuzz.py
@@ -353,8 +353,9 @@ def get_json_from_url(url):
logging.error('HTTP error with url %s.', url)
return None
try:
- result_json = json.load(response)
- except ValueError as excp:
+ # read().decode() fixes compatability issue with urllib response object.
+ result_json = json.loads(response.read().decode())
+ except (ValueError, TypeError, json.JSONDecodeError) as excp:
logging.error('Loading json from url %s failed with: %s.', url, str(excp))
return None
return result_json