From: David Woodhouse Date: Fri, 29 Jun 2012 23:07:49 +0000 (+0100) Subject: Return GNUTLS_E_LARGE_PACKET instead of truncating when sending DTLS record X-Git-Tag: gnutls_3_0_21~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d36d74d99bfc0f12fcd34d093d3c035743e0038;p=thirdparty%2Fgnutls.git Return GNUTLS_E_LARGE_PACKET instead of truncating when sending DTLS record Signed-off-by: Nikos Mavrogiannopoulos --- diff --git a/lib/gnutls_record.c b/lib/gnutls_record.c index e6250f84f1..fbb84a1447 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;