diff options
author | Pascal Terjan <pterjan@mageia.org> | 2020-04-14 20:37:03 +0000 |
---|---|---|
committer | Pascal Terjan <pterjan@mageia.org> | 2020-04-14 20:37:03 +0000 |
commit | 1a7afd9a9cdba83fe79d06b5f92efeebc1ea1971 (patch) | |
tree | ab4798197aaa189aa1f568247093191c431bee93 | |
parent | 9559df13f7e4da55c1bf6c9873924aa4e1a5960b (diff) | |
download | autobuild-1a7afd9a9cdba83fe79d06b5f92efeebc1ea1971.tar autobuild-1a7afd9a9cdba83fe79d06b5f92efeebc1ea1971.tar.gz autobuild-1a7afd9a9cdba83fe79d06b5f92efeebc1ea1971.tar.bz2 autobuild-1a7afd9a9cdba83fe79d06b5f92efeebc1ea1971.tar.xz autobuild-1a7afd9a9cdba83fe79d06b5f92efeebc1ea1971.zip |
Fix a crash in find_bug_matches
-rwxr-xr-x | autobuild.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/autobuild.rb b/autobuild.rb index 89a98bf..7b0c8d5 100755 --- a/autobuild.rb +++ b/autobuild.rb @@ -157,11 +157,15 @@ def find_bug_matches(build_dir) # loop over file File.open(build_file).each_line do |li| - if any_bug_re.match(li) then - # loop over individual regexes to find the matching one - regex_list.each do |regex| - return $bug_matches[regex] if (/#{regex}/.match(li)) + begin + if any_bug_re.match(li) then + # loop over individual regexes to find the matching one + regex_list.each do |regex| + return $bug_matches[regex] if (/#{regex}/.match(li)) + end end + rescue ArgumentError => e + # Some lines have invalid UTF-8, just ignore them end end return '' |