Fixed a gcc-7-strict-warnings issue.
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Fri, 24 Mar 2017 12:18:22 +0000 (13:18 +0100)
committerAndy Polyakov <appro@openssl.org>
Sat, 25 Mar 2017 10:20:31 +0000 (11:20 +0100)
Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3026)

crypto/asn1/a_bitstr.c

index f906188b114b088c44dc71e9270d400b5a07e55d..c429342e03d42a533fff8ce66aaf39e45e027db9 100644 (file)
@@ -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);
 }