From 65e2d97a6af53f1e879c39a80f3d249c578c8e95 Mon Sep 17 00:00:00 2001 From: DavidKorczynski Date: Fri, 12 Aug 2022 09:50:10 +0100 Subject: [PATCH] ftfy: capture unicode encode errors (#8226) fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50062 --- projects/ftfy/fuzz_fix.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/projects/ftfy/fuzz_fix.py b/projects/ftfy/fuzz_fix.py index c1503f7d1..8f0ef4eab 100644 --- a/projects/ftfy/fuzz_fix.py +++ b/projects/ftfy/fuzz_fix.py @@ -35,6 +35,8 @@ def TestInput(data): f.close() ftfy.guess_bytes(fdp.ConsumeBytes(100)) + except UnicodeEncodeError as e2: + pass except UnicodeError as e: if "Hey wait, this isn't Unicode." not in str(e): raise e