summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--ext/openssl/ossl_ssl.c17
2 files changed, 14 insertions, 10 deletions
@@ -1,3 +1,10 @@
Sun Dec 13 06:40:30 2015 Marc-Andre Lafortune <[email protected]>
* lib/ostruct.rb: Have OpenStruct#dig raise if argument is not a
@@ -585,19 +585,16 @@ ssl_npn_select_cb_common(VALUE cb, const unsigned char **out, unsigned char *out
{
VALUE selected;
long len;
- unsigned char l;
VALUE protocols = rb_ary_new();
- /* The format is len_1|proto_1|...|len_n|proto_n\0 */
- while ((l = *in++) != '\0') {
- 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);
in += l;
- inlen -= l;
}
selected = rb_funcall(cb, rb_intern("call"), 1, protocols);