Skip to content

Commit

Permalink
Protect when mismatch between leading_char_index and length of decode…
Browse files Browse the repository at this point in the history
…d_match_string
  • Loading branch information
cccs-kevin committed Apr 10, 2024
1 parent c4e9e53 commit ed09905
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions jsjaws.py
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,8 @@ def log_and_replace(match) -> bytes:
decoded_match_string = match.string.decode()
except UnicodeDecodeError:
return
if leading_char_index > len(decoded_match_string):
return
leading_char = decoded_match_string[leading_char_index]
return f"{leading_char}[{property_name}] = {property_value};".encode()

Expand Down

0 comments on commit ed09905

Please sign in to comment.