summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2017-03-24 13:18:22 +0100
committerAndy Polyakov <appro@openssl.org>2017-03-25 11:20:31 +0100
commitcf5e259d5ba83e62b67ae8bf093f3ef1739812ed (patch)
tree3107e5904cdf27af24192453e793ffe94f13e555 /crypto
parente704d91d273164074b21de348e86ace3e074419e (diff)
Fixed a gcc-7-strict-warnings issue.
Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3026)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/asn1/a_bitstr.c7
1 files changed, 4 insertions, 3 deletions
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);
}