File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -443,7 +443,7 @@ def remove_unparseable files
443443 files . reject do |file , *|
444444 file =~ /\. (?:class|eps|erb|scpt\. txt|svg|ttf|yml)$/i or
445445 ( file =~ /tags$/i and
446- open ( file , 'rb' ) { |io |
446+ File . open ( file , 'rb' ) { |io |
447447 io . read ( 100 ) =~ /\A (\f \n [^,]+,\d +$|!_TAG_)/
448448 } )
449449 end
Original file line number Diff line number Diff line change @@ -456,6 +456,18 @@ def test_remove_unparseable_tags_vim
456456 end
457457 end
458458
459+ def test_remove_unparseable_CVE_2021_31799
460+ temp_dir do
461+ file_list = [ '| touch evil.txt && echo tags' ]
462+ file_list . each do |f |
463+ FileUtils . touch f
464+ end
465+
466+ assert_equal file_list , @rdoc . remove_unparseable ( file_list )
467+ assert_equal file_list , Dir . children ( '.' )
468+ end
469+ end
470+
459471 def test_setup_output_dir
460472 Dir . mktmpdir { |d |
461473 path = File . join d , 'testdir'
You can’t perform that action at this time.
0 commit comments