Skip to content

Commit

Permalink
ignore broken unicode
Browse files Browse the repository at this point in the history
  • Loading branch information
niccokunzmann committed Nov 21, 2023
1 parent dddbafb commit c90092a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/icalendar/fuzzing/ical_fuzzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ def TestOneInput(data):
should_walk = fdp.ConsumeBool()
calendar_string = fdp.ConsumeString(fdp.remaining_bytes())
print("--- start calendar ---")
# print the ICS file for the test case extraction
# see https://stackoverflow.com/a/27367173/1320237
print(base64.b64encode(calendar_string.encode("UTF-8", "surrogateescape")).decode("ASCII"))
try:
# print the ICS file for the test case extraction
# see https://stackoverflow.com/a/27367173/1320237
print(base64.b64encode(calendar_string.encode("UTF-8", "surrogateescape")).decode("ASCII"))
except UnicodeEncodeError: pass
print("--- end calendar ---")

fuzz_calendar_v1(icalendar.Calendar.from_ical, calendar_string, multiple, should_walk)
Expand Down

0 comments on commit c90092a

Please sign in to comment.