OpenSSL Security Advisory [30 July 2002]
[openssl.git] / ssl / ssl_asn1.c
index b1c2d1715325c552ec4a480d6e98ee221deb9410..1638c6b525b35a8c5f816a8d5f9c31202f162d53 100644 (file)
@@ -62,6 +62,7 @@
 #include <openssl/asn1_mac.h>
 #include <openssl/objects.h>
 #include <openssl/x509.h>
+#include "cryptlib.h"
 
 typedef struct ssl_session_asn1_st
        {
@@ -296,6 +297,7 @@ SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, unsigned char **pp,
                os.length=i;
 
        ret->session_id_length=os.length;
+       die(os.length <= sizeof ret->session_id);
        memcpy(ret->session_id,os.data,os.length);
 
        M_ASN1_D2I_get(osp,d2i_ASN1_OCTET_STRING);