Fix i2d_SSL_SESSION pp output parameter should point to end of asn1 data.
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Mon, 13 Feb 2017 12:03:52 +0000 (13:03 +0100)
committerRichard Levitte <levitte@openssl.org>
Tue, 21 Feb 2017 23:49:02 +0000 (00:49 +0100)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2607)
(cherry picked from commit a0179d0afb621a0875ddcfd939719a9628ac4444)

ssl/ssl_asn1.c

index aa6e3e6a13d91660fecbee1cf0ce82dbf33db650..8f55d8fde95d3d30afe8c2399bc5a2284b8ae0df 100644 (file)
@@ -278,8 +278,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 = NULL;
     ret->cipher_id = id;