From 87d2c37a191550bbbc6114a321f3455b5803adf4 Mon Sep 17 00:00:00 2001 From: Arthur Chan Date: Tue, 27 Sep 2022 23:38:44 +0100 Subject: [PATCH] [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) --- projects/oauth2/fuzz_helpers.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/projects/oauth2/fuzz_helpers.py b/projects/oauth2/fuzz_helpers.py index a2a501248..099214f5d 100644 --- a/projects/oauth2/fuzz_helpers.py +++ b/projects/oauth2/fuzz_helpers.py @@ -29,7 +29,8 @@ def TestInput(data): 'Is a directory', 'Incorrect padding', 'Invalid base64-encoded string', - 'could not be converted to' + 'could not be converted to', + 'contains invalid characters under NFKC normalization' ] try: @@ -64,7 +65,7 @@ def TestInput(data): helpers._to_bytes(input) 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() helpers._urlsafe_b64decode(input) except (ValueError, IOError, binascii.Error) as e: