From 4f714939efde6d6b3b74c09e1e151e6ce6818b90 Mon Sep 17 00:00:00 2001 From: nagachika Date: Thu, 23 Jul 2020 14:02:05 +0900 Subject: merge revision(s) e04418bb16cd99b4a4402e7457d3bdc967284f98: [Backport #16830] [ruby/uri] Check if DN exists https://bugs.ruby-lang.org/issues/16830 https://github.com/ruby/uri/commit/b4bf8c1217 --- lib/uri/ldap.rb | 1 + test/uri/test_ldap.rb | 4 ++++ version.h | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/uri/ldap.rb b/lib/uri/ldap.rb index 228c793cbd..61ec3d3f12 100644 --- a/lib/uri/ldap.rb +++ b/lib/uri/ldap.rb @@ -119,6 +119,7 @@ module URI # Private method to cleanup +dn+ from using the +path+ component attribute. def parse_dn + raise InvalidURIError, 'bad LDAP URL' unless @path @dn = @path[1..-1] end private :parse_dn diff --git a/test/uri/test_ldap.rb b/test/uri/test_ldap.rb index adad4454b5..64845e487a 100644 --- a/test/uri/test_ldap.rb +++ b/test/uri/test_ldap.rb @@ -95,6 +95,10 @@ class TestLDAP < Test::Unit::TestCase u.select(:scheme, :host, :not_exist, :port) end end + + def test_parse_invalid_uri + assert_raise(URI::InvalidURIError) {URI.parse("ldap:https://example.com")} + end end diff --git a/version.h b/version.h index e1a6dfd431..874e21aede 100644 --- a/version.h +++ b/version.h @@ -2,7 +2,7 @@ # define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR #define RUBY_VERSION_TEENY 1 #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR -#define RUBY_PATCHLEVEL 102 +#define RUBY_PATCHLEVEL 103 #define RUBY_RELEASE_YEAR 2020 #define RUBY_RELEASE_MONTH 7 -- cgit v1.2.3