Project

General

Profile

Bug #11369 ยป 0007-Check-length-of-selected-NPN-protocol.patch

jeremyevans0 (Jeremy Evans), 07/17/2015 09:39 PM

View differences:

ext/openssl/ossl_ssl.c
selected = rb_funcall(cb, rb_intern("call"), 1, protocols);
StringValue(selected);
i = RSTRING_LENINT(selected);
if (i < 1 || i >= 256) {
ossl_raise(eSSLError, "Selected protocol must have length 1..255");
}
*out = (unsigned char *) StringValuePtr(selected);
*outlen = RSTRING_LENINT(selected);
*outlen = i;
return SSL_TLSEXT_ERR_OK;
}
#endif
    (1-1/1)