From 4250ba74e27c2c2983e644a3cc81c7b346b814ae Mon Sep 17 00:00:00 2001 From: tb Date: Tue, 25 Apr 2023 07:50:38 +0000 Subject: [PATCH] Fix allocation size Reported by anton --- lib/libssl/ssl_tlsext.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libssl/ssl_tlsext.c b/lib/libssl/ssl_tlsext.c index f94469949cb..bfceadfe960 100644 --- a/lib/libssl/ssl_tlsext.c +++ b/lib/libssl/ssl_tlsext.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_tlsext.c,v 1.134 2023/04/24 16:55:06 tb Exp $ */ +/* $OpenBSD: ssl_tlsext.c,v 1.135 2023/04/25 07:50:38 tb Exp $ */ /* * Copyright (c) 2016, 2017, 2019 Joel Sing * Copyright (c) 2017 Doug Hogan @@ -2250,7 +2250,7 @@ tlsext_randomize_build_order(SSL *s) free(s->tlsext_build_order); s->tlsext_build_order_len = 0; - if ((s->tlsext_build_order = calloc(s->tlsext_build_order_len, + if ((s->tlsext_build_order = calloc(sizeof(*s->tlsext_build_order), N_TLS_EXTENSIONS)) == NULL) return 0; s->tlsext_build_order_len = N_TLS_EXTENSIONS; @@ -2299,7 +2299,7 @@ tlsext_linearize_build_order(SSL *s) free(s->tlsext_build_order); s->tlsext_build_order_len = 0; - if ((s->tlsext_build_order = calloc(s->tlsext_build_order_len, + if ((s->tlsext_build_order = calloc(sizeof(*s->tlsext_build_order), N_TLS_EXTENSIONS)) == NULL) return 0; s->tlsext_build_order_len = N_TLS_EXTENSIONS; -- 2.20.1