Fixes #507
This commit is contained in:
parent
734ba7ec50
commit
25c26a3b7a
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user