summaryrefslogtreecommitdiff
path: root/ssl/record/methods
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2022-10-05 15:01:18 +0100
committerMatt Caswell <matt@openssl.org>2022-10-12 15:53:31 +0100
commitf78c51995e35889d39cb0bdadcbfa3e144bd8a29 (patch)
treee51fe3c3908869563266972b3eff187b33980a92 /ssl/record/methods
parentace3819506d8d6bd298dd8448fefcbd62b63580c (diff)
downloadopenssl-new-f78c51995e35889d39cb0bdadcbfa3e144bd8a29.tar.gz
Fix a return value in tls_default_read_n
Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19343)
Diffstat (limited to 'ssl/record/methods')
-rw-r--r--ssl/record/methods/tls_common.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/ssl/record/methods/tls_common.c b/ssl/record/methods/tls_common.c
index d3f6439184..dd497ed1de 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;
}