Skip to content

Commit

Permalink
Merge pull request #699 from CybercentreCanada/bugfix/dividing-comment
Browse files Browse the repository at this point in the history
Adding handling for previously generated files [dev]
  • Loading branch information
cccs-kevin authored Feb 21, 2024
2 parents 2d043d5 + 35b8385 commit 16810b9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions jsjaws.py
Original file line number Diff line number Diff line change
Expand Up @@ -1401,6 +1401,10 @@ def _run_the_gauntlet(self, request, file_path, file_content, subsequent_run: bo
split_content = file_content.split(f"{DIVIDING_COMMENT}\n".encode())
if len(split_content) == 2:
_, script_we_did_not_generate = split_content
# Looks like a file generated by JsJaws and attached as supplementary was resubmitted for analysis.
# Therefore we have to massage the file contents
elif len(split_content) > 2:
_, script_we_did_not_generate = split_content[-2:]
else:
script_we_did_not_generate = file_content
if script_we_did_not_generate == b"" and not self.sus_form_actions:
Expand Down

0 comments on commit 16810b9

Please sign in to comment.