From b6a7c7fe4bccdc5ae0b1fdc9395ffc8977436466 Mon Sep 17 00:00:00 2001 From: bcook <> Date: Sun, 17 Jul 2016 22:01:01 +0000 Subject: use memset to initialize the union --- src/lib/libcrypto/bn/bn_nist.c | 6 ++++-- src/lib/libssl/src/crypto/bn/bn_nist.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libcrypto/bn/bn_nist.c b/src/lib/libcrypto/bn/bn_nist.c index 44bf0cb0ce..9a0970138d 100644 --- a/src/lib/libcrypto/bn/bn_nist.c +++ b/src/lib/libcrypto/bn/bn_nist.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_nist.c,v 1.16 2016/07/17 21:21:40 bcook Exp $ */ +/* $OpenBSD: bn_nist.c,v 1.17 2016/07/17 22:01:01 bcook Exp $ */ /* * Written by Nils Larsch for the OpenSSL project */ @@ -59,6 +59,7 @@ #include #include +#include #include "bn_lcl.h" @@ -568,7 +569,8 @@ BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *field, BN_CTX *ctx) BN_ULONG bn[BN_NIST_224_TOP]; unsigned int ui[BN_NIST_224_TOP * sizeof(BN_ULONG) / sizeof(unsigned int)]; - } buf = {0}; + } buf; + memset(&buf, 0, sizeof(buf)); BN_ULONG c_d[BN_NIST_224_TOP], *res; uintptr_t mask; union { diff --git a/src/lib/libssl/src/crypto/bn/bn_nist.c b/src/lib/libssl/src/crypto/bn/bn_nist.c index 44bf0cb0ce..9a0970138d 100644 --- a/src/lib/libssl/src/crypto/bn/bn_nist.c +++ b/src/lib/libssl/src/crypto/bn/bn_nist.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_nist.c,v 1.16 2016/07/17 21:21:40 bcook Exp $ */ +/* $OpenBSD: bn_nist.c,v 1.17 2016/07/17 22:01:01 bcook Exp $ */ /* * Written by Nils Larsch for the OpenSSL project */ @@ -59,6 +59,7 @@ #include #include +#include #include "bn_lcl.h" @@ -568,7 +569,8 @@ BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *field, BN_CTX *ctx) BN_ULONG bn[BN_NIST_224_TOP]; unsigned int ui[BN_NIST_224_TOP * sizeof(BN_ULONG) / sizeof(unsigned int)]; - } buf = {0}; + } buf; + memset(&buf, 0, sizeof(buf)); BN_ULONG c_d[BN_NIST_224_TOP], *res; uintptr_t mask; union { -- cgit v1.2.3-55-g6feb