summaryrefslogtreecommitdiffstats
path: root/lib/libssl/ssl_lib.c
diff options
context:
space:
mode:
authormestre <mestre@openbsd.org>2018-11-14 17:24:14 +0000
committermestre <mestre@openbsd.org>2018-11-14 17:24:14 +0000
commitfe7233972ca86e7346f97e61b964731b4165142a (patch)
treed2de54db5ce3e9cd37eda69a4e4279e49012850c /lib/libssl/ssl_lib.c
parentPlug memory leak in host()'s error code path (diff)
downloadwireguard-openbsd-fe7233972ca86e7346f97e61b964731b4165142a.tar.xz
wireguard-openbsd-fe7233972ca86e7346f97e61b964731b4165142a.zip
Fix wrong sizeof argument by using 'uint16_t *', with minor nit from tb@,
instead of 'uint16_t' Found with llvm's static analyzer, noticed that it was also already reported in Coverity CID 155890 and to ensure this was correct also inspected OpenSSL's equivalent code. OK tb@ and jsing@
Diffstat (limited to 'lib/libssl/ssl_lib.c')
-rw-r--r--lib/libssl/ssl_lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libssl/ssl_lib.c b/lib/libssl/ssl_lib.c
index 66e14b98161..b69b7cecfec 100644
--- a/lib/libssl/ssl_lib.c
+++ b/lib/libssl/ssl_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl_lib.c,v 1.193 2018/11/11 06:58:14 tb Exp $ */
+/* $OpenBSD: ssl_lib.c,v 1.194 2018/11/14 17:24:14 mestre Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -312,7 +312,7 @@ SSL_new(SSL_CTX *ctx)
if (ctx->internal->tlsext_supportedgroups != NULL) {
s->internal->tlsext_supportedgroups =
calloc(ctx->internal->tlsext_supportedgroups_length,
- sizeof(ctx->internal->tlsext_supportedgroups));
+ sizeof(ctx->internal->tlsext_supportedgroups[0]));
if (s->internal->tlsext_supportedgroups == NULL)
goto err;
memcpy(s->internal->tlsext_supportedgroups,