summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2011-03-20 14:23:16 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2011-03-20 14:23:16 +0100
commit623fa5cb3494f950c7e6f3158c183023c860ce1f (patch)
treea3a32ef52e45414b633652d33ed6daf3be2e5ea0
parentfea199c8bb0ecab59aaef04fc2eec30e17b4b97b (diff)
downloadgnutls-623fa5cb3494f950c7e6f3158c183023c860ce1f.tar.gz
ensure addition to application data buffers is occuring only after a successful handshake.
-rw-r--r--lib/gnutls_record.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/gnutls_record.c b/lib/gnutls_record.c
index 8ed84f2c1d..15f4fced7f 100644
--- a/lib/gnutls_record.c
+++ b/lib/gnutls_record.c
@@ -745,6 +745,12 @@ record_check_type (gnutls_session_t session,
return GNUTLS_E_UNEXPECTED_PACKET;
case GNUTLS_APPLICATION_DATA:
+ if (session->internals.initial_negotiation_completed == 0)
+ {
+ ret = gnutls_assert_val(GNUTLS_E_UNEXPECTED_PACKET);
+ goto cleanup;
+ }
+
/* even if data is unexpected put it into the buffer */
if ((ret =
_gnutls_record_buffer_put (recv_type, session,