From: Bernd Edlinger Date: Mon, 13 Feb 2017 12:03:52 +0000 (+0100) Subject: Fix i2d_SSL_SESSION pp output parameter should point to end of asn1 data. X-Git-Tag: OpenSSL_1_1_1-pre1~2318 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a0179d0afb621a0875ddcfd939719a9628ac4444;p=oweals%2Fopenssl.git Fix i2d_SSL_SESSION pp output parameter should point to end of asn1 data. Reviewed-by: Matt Caswell Reviewed-by: Rich Salz Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/2607) --- diff --git a/ssl/ssl_asn1.c b/ssl/ssl_asn1.c index 73ba78dbe5..8141471915 100644 --- a/ssl/ssl_asn1.c +++ b/ssl/ssl_asn1.c @@ -281,8 +281,8 @@ SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp, goto err; } - p = as->cipher->data; - id = 0x03000000L | ((unsigned long)p[0] << 8L) | (unsigned long)p[1]; + id = 0x03000000L | ((unsigned long)as->cipher->data[0] << 8L) + | (unsigned long)as->cipher->data[1]; ret->cipher_id = id; ret->cipher = ssl3_get_cipher_by_id(id);