diff options
author | Benoit Daloze <[email protected]> | 2019-07-27 12:40:09 +0200 |
---|---|---|
committer | Benoit Daloze <[email protected]> | 2019-07-27 12:40:09 +0200 |
commit | 5c276e1cc91c5ab2a41fbf7827af2fed914a2bc0 (patch) | |
tree | 05b5c68c8b2a00224d4646ea3b26ce3877efaadd /spec/ruby/security | |
parent | a06301b103371b0b7da8eaca26ba744961769f99 (diff) |
Update to ruby/spec@875a09e
Diffstat (limited to 'spec/ruby/security')
-rw-r--r-- | spec/ruby/security/cve_2010_1330_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/security/cve_2014_8080_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/security/cve_2018_8778_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/security/cve_2018_8779_spec.rb | 4 | ||||
-rw-r--r-- | spec/ruby/security/cve_2018_8780_spec.rb | 12 |
5 files changed, 11 insertions, 11 deletions
diff --git a/spec/ruby/security/cve_2010_1330_spec.rb b/spec/ruby/security/cve_2010_1330_spec.rb index 5593bc0845..fa4c756c6d 100644 --- a/spec/ruby/security/cve_2010_1330_spec.rb +++ b/spec/ruby/security/cve_2010_1330_spec.rb @@ -13,7 +13,7 @@ describe "String#gsub" do str.force_encoding Encoding::BINARY str.gsub(/</, "<").should == "\xF6<script>".b str.force_encoding Encoding::UTF_8 - lambda { + -> { str.gsub(/</, "<") }.should raise_error(ArgumentError, /invalid byte sequence in UTF-8/) end diff --git a/spec/ruby/security/cve_2014_8080_spec.rb b/spec/ruby/security/cve_2014_8080_spec.rb index e9d7fd320c..64e22cf3a7 100644 --- a/spec/ruby/security/cve_2014_8080_spec.rb +++ b/spec/ruby/security/cve_2014_8080_spec.rb @@ -24,7 +24,7 @@ describe "REXML::Document.new" do </x> XML - lambda { + -> { REXML::Document.new(xml).doctype.entities['x9'].value }.should raise_error(REXML::ParseException, /entity expansion has grown too large/) end diff --git a/spec/ruby/security/cve_2018_8778_spec.rb b/spec/ruby/security/cve_2018_8778_spec.rb index a264a8581e..628159a4db 100644 --- a/spec/ruby/security/cve_2018_8778_spec.rb +++ b/spec/ruby/security/cve_2018_8778_spec.rb @@ -4,7 +4,7 @@ describe "String#unpack" do it "resists CVE-2018-8778 by raising an exception when a position indicator is larger than a native integer" do pos = (1 << PlatformGuard::POINTER_SIZE) - 99 - lambda { + -> { "0123456789".unpack("@#{pos}C10") }.should raise_error(RangeError, /pack length too big/) end diff --git a/spec/ruby/security/cve_2018_8779_spec.rb b/spec/ruby/security/cve_2018_8779_spec.rb index 9659b321ee..603dcf497b 100644 --- a/spec/ruby/security/cve_2018_8779_spec.rb +++ b/spec/ruby/security/cve_2018_8779_spec.rb @@ -16,13 +16,13 @@ platform_is_not :windows do end it "UNIXServer.open by raising an exception when there is a NUL byte" do - lambda { + -> { UNIXServer.open(@path+"\0") }.should raise_error(ArgumentError, /(path name|string) contains null byte/) end it "UNIXSocket.open by raising an exception when there is a NUL byte" do - lambda { + -> { UNIXSocket.open(@path+"\0") }.should raise_error(ArgumentError, /(path name|string) contains null byte/) end diff --git a/spec/ruby/security/cve_2018_8780_spec.rb b/spec/ruby/security/cve_2018_8780_spec.rb index d9c02fbbd1..555ce9365c 100644 --- a/spec/ruby/security/cve_2018_8780_spec.rb +++ b/spec/ruby/security/cve_2018_8780_spec.rb @@ -6,38 +6,38 @@ describe "CVE-2018-8780 is resisted by" do end it "Dir.glob by raising an exception when there is a NUL byte" do - lambda { + -> { Dir.glob([[@root, File.join(@root, "*")].join("\0")]) }.should raise_error(ArgumentError, /(path name|string) contains null byte/) end it "Dir.entries by raising an exception when there is a NUL byte" do - lambda { + -> { Dir.entries(@root+"\0") }.should raise_error(ArgumentError, /(path name|string) contains null byte/) end it "Dir.foreach by raising an exception when there is a NUL byte" do - lambda { + -> { Dir.foreach(@root+"\0").to_a }.should raise_error(ArgumentError, /(path name|string) contains null byte/) end it "Dir.empty? by raising an exception when there is a NUL byte" do - lambda { + -> { Dir.empty?(@root+"\0") }.should raise_error(ArgumentError, /(path name|string) contains null byte/) end ruby_version_is "2.5" do it "Dir.children by raising an exception when there is a NUL byte" do - lambda { + -> { Dir.children(@root+"\0") }.should raise_error(ArgumentError, /(path name|string) contains null byte/) end it "Dir.each_child by raising an exception when there is a NUL byte" do - lambda { + -> { Dir.each_child(@root+"\0").to_a }.should raise_error(ArgumentError, /(path name|string) contains null byte/) end |