Skip to content

Commit

Permalink
fix broken unicode
Browse files Browse the repository at this point in the history
  • Loading branch information
niccokunzmann committed Nov 21, 2023
1 parent d039b71 commit dddbafb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/icalendar/fuzzing/ical_fuzzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@

@atheris.instrument_func
def TestOneInput(data):
print("sys.argv: ", sys.argv)
fdp = atheris.FuzzedDataProvider(data)
try:
multiple = fdp.ConsumeBool()
should_walk = fdp.ConsumeBool()
calendar_string = fdp.ConsumeString(fdp.remaining_bytes())
print("--- start calendar ---")
print(base64.b64encode(calendar_string.encode("UTF-8")).decode("ASCII"))
# 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"))
print("--- end calendar ---")

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

0 comments on commit dddbafb

Please sign in to comment.