Fix crash in dtls1_get_record whilst in the listen state where you get two
[archaic-openssl.git] / ssl / s3_pkt.c
index 2de10d644efd46a9841b0d50b74f028716ce0a6a..3d8f821f92b9168f3c7b9504096e00de5ff32435 100644 (file)
@@ -197,6 +197,8 @@ int ssl3_read_n(SSL *s, int n, int max, int extend)
         * at once (as long as it fits into the buffer). */
        if (SSL_IS_DTLS(s))
                {
+               if (left == 0 && extend)
+                       return 0;
                if (left > 0 && n > left)
                        n = left;
                }