]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix a return value in tls_default_read_n
authorMatt Caswell <matt@openssl.org>
Wed, 5 Oct 2022 14:01:18 +0000 (15:01 +0100)
committerMatt Caswell <matt@openssl.org>
Wed, 12 Oct 2022 14:53:31 +0000 (15:53 +0100)
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19343)

ssl/record/methods/tls_common.c

index d3f643918480a8d92805f5f7224a7f6d88230f43..dd497ed1de98b8a9b76a8b474336509a685ba48c 100644 (file)
@@ -322,8 +322,13 @@ int tls_default_read_n(OSSL_RECORD_LAYER *rl, size_t n, size_t max, int extend,
      * the buffer).
      */
     if (rl->isdtls) {
-        if (left == 0 && extend)
-            return 0;
+        if (left == 0 && extend) {
+            /*
+             * We received a record with a header but no body data. This will
+             * get dumped.
+             */
+            return OSSL_RECORD_RETURN_NON_FATAL_ERR;
+        }
         if (left > 0 && n > left)
             n = left;
     }