提交 c7558d5b 编写于 作者: P Paul Yang 提交者: Matt Caswell

Fix reading heap overflow in a test case

Caught by AddressSanitizer
Reviewed-by: NBen Kaduk <kaduk@mit.edu>
Reviewed-by: NMatt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4497)
上级 21c21542
......@@ -1974,15 +1974,16 @@ static int hostname_cb(SSL *s, int *al, void *arg)
static const char *servalpn;
static int alpn_select_cb (SSL *ssl, const unsigned char **out, unsigned char *outlen,
const unsigned char *in, unsigned int inlen, void *arg)
static int alpn_select_cb(SSL *ssl, const unsigned char **out,
unsigned char *outlen, const unsigned char *in,
unsigned int inlen, void *arg)
{
unsigned int i, protlen = 0;
unsigned int protlen = 0;
const unsigned char *prot;
for (i = 0, prot = in; i < inlen; i += protlen, prot += protlen) {
protlen = *(prot++);
if (inlen - i < protlen)
for (prot = in; prot < in + inlen; prot += protlen) {
protlen = *prot++;
if (in + inlen - prot < protlen)
return SSL_TLSEXT_ERR_NOACK;
if (protlen == strlen(servalpn)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册