File tree 2 files changed +13
-1
lines changed
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
443
443
files . reject do |file , *|
444
444
file =~ /\. (?:class|eps|erb|scpt\. txt|svg|ttf|yml)$/i or
445
445
( file =~ /tags$/i and
446
- open ( file , 'rb' ) { |io |
446
+ File . open ( file , 'rb' ) { |io |
447
447
io . read ( 100 ) =~ /\A (\f \n [^,]+,\d +$|!_TAG_)/
448
448
} )
449
449
end
Original file line number Diff line number Diff line change @@ -456,6 +456,18 @@ def test_remove_unparseable_tags_vim
456
456
end
457
457
end
458
458
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
+
459
471
def test_setup_output_dir
460
472
Dir . mktmpdir { |d |
461
473
path = File . join d , 'testdir'
You can’t perform that action at this time.
0 commit comments