Skip to content

Commit 40e4a66

Browse files
committed
catch case where blen%8 != 0
1 parent 3fef07c commit 40e4a66

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/pk/asn1/der/bit/der_decode_raw_bit_string.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ int der_decode_raw_bit_string(const unsigned char *in, unsigned long inlen,
7878
blen = ((dlen - 1) << 3) - (in[x++] & 7);
7979

8080
/* too many bits? */
81-
if (blen/8 > *outlen) {
81+
if ((blen + 7)/8 > *outlen) {
8282
*outlen = blen;
8383
return CRYPT_BUFFER_OVERFLOW;
8484
}

0 commit comments

Comments
 (0)