[oauth2]: fix unicode error and other error handling for issue 51904 (#8609)

Fix error handling for issue
51904 (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=51904)
This commit is contained in:
Arthur Chan 2022-09-27 23:38:44 +01:00 committed by GitHub
parent f8d1439cd6
commit 87d2c37a19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -29,7 +29,8 @@ def TestInput(data):
'Is a directory', 'Is a directory',
'Incorrect padding', 'Incorrect padding',
'Invalid base64-encoded string', 'Invalid base64-encoded string',
'could not be converted to' 'could not be converted to',
'contains invalid characters under NFKC normalization'
] ]
try: try:
@ -64,7 +65,7 @@ def TestInput(data):
helpers._to_bytes(input) helpers._to_bytes(input)
helpers._from_bytes(fdp.ConsumeUnicodeNoSurrogates(100)) helpers._from_bytes(fdp.ConsumeUnicodeNoSurrogates(100))
helpers._urlsafe_b64encode(fdp.ConsumeString(100)) helpers._urlsafe_b64encode(fdp.ConsumeUnicodeNoSurrogates(100))
input = fdp.ConsumeString(100).encode('ascii', errors='ignore').decode() input = fdp.ConsumeString(100).encode('ascii', errors='ignore').decode()
helpers._urlsafe_b64decode(input) helpers._urlsafe_b64decode(input)
except (ValueError, IOError, binascii.Error) as e: except (ValueError, IOError, binascii.Error) as e: