PR: 1923
authorDr. Stephen Henson <steve@openssl.org>
Wed, 13 May 2009 11:51:30 +0000 (11:51 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Wed, 13 May 2009 11:51:30 +0000 (11:51 +0000)
Submitted by: Daniel Mentz <daniel.m@sent.com>, Robin Seggelmann <seggelmann@fh-muenster.de>
Approved by: steve@openssl.org

Don't access freed data structure.

ssl/d1_both.c

index ffbe5131d78a2ecba229b14abfb75f98de802601..8883760da50e6683584cecfd35a8c83ec56fd067 100644 (file)
@@ -519,6 +519,7 @@ dtls1_retrieve_buffered_fragment(SSL *s, long max, int *ok)
 
        if ( s->d1->handshake_read_seq == frag->msg_header.seq)
                {
+               unsigned long frag_len = frag->msg_header.frag_len;
                pqueue_pop(s->d1->buffered_messages);
 
                al=dtls1_preprocess_fragment(s,&frag->msg_header,max);
@@ -536,7 +537,7 @@ dtls1_retrieve_buffered_fragment(SSL *s, long max, int *ok)
                if (al==0)
                        {
                        *ok = 1;
-                       return frag->msg_header.frag_len;
+                       return frag_len;
                        }
 
                ssl3_send_alert(s,SSL3_AL_FATAL,al);