Fix a slightly confusing if condition in a2i_ASN1_ENUMERATED.
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Wed, 15 Feb 2017 19:42:40 +0000 (20:42 +0100)
committerRich Salz <rsalz@openssl.org>
Fri, 17 Feb 2017 14:53:10 +0000 (09:53 -0500)
Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2641)

crypto/asn1/f_enum.c

index 94cd54dbeedd3a2fbfcf790308715c9e92251eb8..527f1d8f87b3f2980f090e196f61cc0fe7bedb38 100644 (file)
@@ -138,7 +138,7 @@ int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size)
         bufp = (unsigned char *)buf;
         if (first) {
             first = 0;
-            if ((bufp[0] == '0') && (buf[1] == '0')) {
+            if ((bufp[0] == '0') && (bufp[1] == '0')) {
                 bufp += 2;
                 i -= 2;
             }