Skip to content

Commit

Permalink
Merge pull request #703 from CybercentreCanada/bugfix/protect-leading…
Browse files Browse the repository at this point in the history
…-char-index

Bugfix/protect leading char index
  • Loading branch information
cccs-kevin authored Apr 10, 2024
2 parents 8fcc78e + ed09905 commit 46fb77f
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 46fb77f

Please sign in to comment.