Skip to content

Commit

Permalink
Bugfix
Browse files Browse the repository at this point in the history
- YaraFileProcessor.__replace_for_each_one_to_many() did not handle lines with only spaces or tabs well. Since the non_white_space_index only got set higher then 0 if a non_white_space character
was found likes without spaces or tabs would double in size.
- Added a check, if non_white_space_index == 0 then set it to the lenghth of the line.
  • Loading branch information
cccs-gm committed Feb 25, 2021
1 parent b691eb2 commit f004d60
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions yara-validator/yara_file_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ def __replace_for_each_one_to_many(self, line):
non_white_space_index = index
break

if non_white_space_index == 0:
non_white_space_index = len(line_as_list)
new_list = new_list + line_as_list[non_white_space_index:]

newline = ''.join(new_list)
Expand Down

0 comments on commit f004d60

Please sign in to comment.