From: Bernd Edlinger Date: Fri, 24 Mar 2017 12:18:22 +0000 (+0100) Subject: Fixed a gcc-7-strict-warnings issue. X-Git-Tag: OpenSSL_1_0_2l~31 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=cf5e259d5ba83e62b67ae8bf093f3ef1739812ed;p=oweals%2Fopenssl.git Fixed a gcc-7-strict-warnings issue. Reviewed-by: Andy Polyakov Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/3026) --- diff --git a/crypto/asn1/a_bitstr.c b/crypto/asn1/a_bitstr.c index f906188b11..c429342e03 100644 --- a/crypto/asn1/a_bitstr.c +++ b/crypto/asn1/a_bitstr.c @@ -114,10 +114,11 @@ int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp) *(p++) = (unsigned char)bits; d = a->data; - memcpy(p, d, len); - p += len; - if (len > 0) + if (len > 0) { + memcpy(p, d, len); + p += len; p[-1] &= (0xff << bits); + } *pp = p; return (ret); }