]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Ensure we properly release DTLS buffered app data records
authorMatt Caswell <matt@openssl.org>
Fri, 2 May 2025 15:37:32 +0000 (16:37 +0100)
committerTodd Short <todd.short@me.com>
Thu, 8 May 2025 18:14:12 +0000 (14:14 -0400)
If we read an app data record before we have read the Finished we buffer
it. Once we've read it we need to make sure we've properly released it
otherwise we will attempt to read it again (and this time there will be
no data in it).

Fixes #27316

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/27543)

ssl/record/rec_layer_s3.c

index cce236bb7b2b38effa08f3f6633a910c5768aa40..1e4c748868a7be0659cb0d2289b3e9c30f7da989 100644 (file)
@@ -569,6 +569,7 @@ int ssl_release_record(SSL_CONNECTION *s, TLS_RECORD *rr, size_t length)
         /* We allocated the buffers for this record (only happens with DTLS) */
         OPENSSL_free(rr->allocdata);
         rr->allocdata = NULL;
+        s->rlayer.curr_rec++;
     }
     rr->length -= length;
     if (rr->length > 0)