From d2e9c28db1e26f296789af6c7bad176cfda708fc Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Sat, 30 Jun 2012 00:07:49 +0100 Subject: [PATCH] Return GNUTLS_E_LARGE_PACKET instead of truncating when sending DTLS record Signed-off-by: Nikos Mavrogiannopoulos --- lib/gnutls_record.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/gnutls_record.c b/lib/gnutls_record.c index e6250f84f..fbb84a144 100644 --- a/lib/gnutls_record.c +++ b/lib/gnutls_record.c @@ -384,7 +384,14 @@ _gnutls_send_int (gnutls_session_t session, content_type_t type, _gnutls_packet2str (type), type, (int) data_size); if (data_size > MAX_RECORD_SEND_SIZE(session)) - send_data_size = MAX_RECORD_SEND_SIZE(session); + { + if (IS_DTLS(session)) + { + gnutls_assert (); + return GNUTLS_E_LARGE_PACKET; + } + send_data_size = MAX_RECORD_SEND_SIZE(session); + } else send_data_size = data_size; -- 2.11.4.GIT