Browse Source

Merge pull request #508 from werew/develop

Fixes #507
Steffen Jaeckel 6 years ago
parent
commit
64d1153e5a
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/pk/asn1/der/utf8/der_decode_utf8_string.c

+ 1 - 1
src/pk/asn1/der/utf8/der_decode_utf8_string.c

@@ -65,7 +65,7 @@ int der_decode_utf8_string(const unsigned char *in,  unsigned long inlen,
       /* count number of bytes */
       for (z = 0; (tmp & 0x80) && (z <= 4); z++, tmp = (tmp << 1) & 0xFF);
 
-      if (z > 4 || (x + (z - 1) > inlen)) {
+      if (z == 1 || z > 4 || (x + (z - 1) > inlen)) {
          return CRYPT_INVALID_PACKET;
       }