From df22426effa512ebec9011df9ac79e3c9faf2baa Mon Sep 17 00:00:00 2001 From: mestre <> Date: Wed, 14 Nov 2018 17:24:14 +0000 Subject: 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@ --- src/lib/libssl/ssl_lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c index 66e14b9816..b69b7cecfe 100644 --- a/src/lib/libssl/ssl_lib.c +++ b/src/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, -- cgit v1.2.3-55-g6feb