From: Matt Caswell Date: Wed, 5 Oct 2022 14:01:18 +0000 (+0100) Subject: Fix a return value in tls_default_read_n X-Git-Tag: openssl-3.2.0-alpha1~1922 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f78c51995e35889d39cb0bdadcbfa3e144bd8a29;p=thirdparty%2Fopenssl.git Fix a return value in tls_default_read_n Reviewed-by: Hugo Landau Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/19343) --- diff --git a/ssl/record/methods/tls_common.c b/ssl/record/methods/tls_common.c index d3f64391848..dd497ed1de9 100644 --- a/ssl/record/methods/tls_common.c +++ b/ssl/record/methods/tls_common.c @@ -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; }