ruby-changes:44725
From: usa <ko1@a...>
Date: Tue, 15 Nov 2016 15:33:42 +0900 (JST)
Subject: [ruby-changes:44725] usa:r56798 (ruby_2_2): merge revision(s) 53064: [Backport #11810]
usa 2016-11-15 15:33:36 +0900 (Tue, 15 Nov 2016) New Revision: 56798 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56798 Log: merge revision(s) 53064: [Backport #11810] * ext/openssl/ossl_ssl.c (ssl_npn_select_cb_common): fix parsing protocol list. The protocol list from OpenSSL is not null-terminated. patched by Kazuki Yamaguchi [Bug #11810] [ruby-core:72082] Modified directories: branches/ruby_2_2/ Modified files: branches/ruby_2_2/ChangeLog branches/ruby_2_2/ext/openssl/ossl_ssl.c branches/ruby_2_2/version.h Index: ruby_2_2/ChangeLog =================================================================== --- ruby_2_2/ChangeLog (revision 56797) +++ ruby_2_2/ChangeLog (revision 56798) @@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1 +Tue Nov 15 15:29:36 2016 NARUSE, Yui <naruse@r...> + + * ext/openssl/ossl_ssl.c (ssl_npn_select_cb_common): fix parsing + protocol list. + The protocol list from OpenSSL is not null-terminated. + patched by Kazuki Yamaguchi [Bug #11810] [ruby-core:72082] + Tue Nov 15 03:55:45 2016 NARUSE, Yui <naruse@r...> * ext/-test/file/fs.c (get_atime_p): Updating of file access times Index: ruby_2_2/version.h =================================================================== --- ruby_2_2/version.h (revision 56797) +++ ruby_2_2/version.h (revision 56798) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1 #define RUBY_VERSION "2.2.6" #define RUBY_RELEASE_DATE "2016-11-15" -#define RUBY_PATCHLEVEL 395 +#define RUBY_PATCHLEVEL 396 #define RUBY_RELEASE_YEAR 2016 #define RUBY_RELEASE_MONTH 11 Index: ruby_2_2/ext/openssl/ossl_ssl.c =================================================================== --- ruby_2_2/ext/openssl/ossl_ssl.c (revision 56797) +++ ruby_2_2/ext/openssl/ossl_ssl.c (revision 56798) @@ -614,19 +614,16 @@ ssl_npn_select_cb_common(VALUE cb, const https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/openssl/ossl_ssl.c#L614 { VALUE selected; long len; - unsigned char l; VALUE protocols = rb_ary_new(); + unsigned char l; + const unsigned char *in_end = in + inlen; - /* The format is len_1|proto_1|...|len_n|proto_n\0 */ - while (l = *in++) { - VALUE protocol; - if (l > inlen) { - ossl_raise(eSSLError, "Invalid protocol name list"); - } - protocol = rb_str_new((const char *)in, l); - rb_ary_push(protocols, protocol); + /* assume OpenSSL verifies this format */ + /* The format is len_1|proto_1|...|len_n|proto_n */ + while (in < in_end) { + l = *in++; + rb_ary_push(protocols, rb_str_new((const char *)in, l)); in += l; - inlen -= l; } selected = rb_funcall(cb, rb_intern("call"), 1, protocols); Property changes on: ruby_2_2 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r53064 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/