]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Disallow zero fragments in DTLS for packets which have data.
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Thu, 4 Sep 2014 12:23:44 +0000 (14:23 +0200)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Thu, 4 Sep 2014 12:24:03 +0000 (14:24 +0200)
Reported by Manuel Pégourié-Gonnard.

lib/gnutls_dtls.c

index 3b1432208173257aefb49ff8b9f6ff2e13dbddd3..ab02721a8d1a1d5b146506e7e3ee325e4000b1c4 100644 (file)
@@ -107,6 +107,14 @@ transmit_message(gnutls_session_t session,
                else
                        frag_len = mtu;
 
+               /* we normally allow fragments of zero length, to allow
+                * the packets which have zero size. On the others don't
+                * send such fragments */
+               if (frag_len == 0 && data_size > 0) {
+                       ret = 0;
+                       break;
+               }
+
                /* Fragment offset */
                _gnutls_write_uint24(offset, &mtu_data[6]);