]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Ensure the rrl object is set to NULL after it is freed
authorMatt Caswell <matt@openssl.org>
Wed, 27 Jul 2022 13:52:13 +0000 (14:52 +0100)
committerMatt Caswell <matt@openssl.org>
Thu, 18 Aug 2022 15:38:14 +0000 (16:38 +0100)
Once we free the rrl object we should NULL it to prevent a dangling ref
to it. Otherwise we could get a double free.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18132)

ssl/record/rec_layer_s3.c

index 807cc43c15da12ee46096bd407f28a3d12f3132d..c187141ee9807ae6d8fde1d55815cf64c2d73620 100644 (file)
@@ -1774,6 +1774,7 @@ int ssl_set_new_record_layer(SSL_CONNECTION *s, int version,
         return 0;
     }
 
+    s->rlayer.rrl = NULL;
     if (meth != NULL)
         s->rlayer.rrlmethod = meth;