diff options
author | Kai Engert <kaie@kuix.de> | 2016-02-18 22:47:09 +0100 |
---|---|---|
committer | Kai Engert <kaie@kuix.de> | 2016-02-18 22:47:09 +0100 |
commit | 3a8f01ecca1d2f618dbdf0024540047f3c90bf6e (patch) | |
tree | e608fa5ae2d70d0df84bb6443a12d38c5928e62f /lib/util/secasn1d.c | |
parent | 42d8361b2675fe29c9e8deb9dc5ddd50875622f3 (diff) | |
download | nss-hg-3a8f01ecca1d2f618dbdf0024540047f3c90bf6e.tar.gz |
bug 1245528, another bustage fix for older compilers
Diffstat (limited to 'lib/util/secasn1d.c')
-rw-r--r-- | lib/util/secasn1d.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/util/secasn1d.c b/lib/util/secasn1d.c index 1969f2df3..7628d65a5 100644 --- a/lib/util/secasn1d.c +++ b/lib/util/secasn1d.c @@ -1618,13 +1618,14 @@ sec_asn1d_parse_leaf (sec_asn1d_state *state, offset = item->len >> 3; } if (state->underlying_kind == SEC_ASN1_BIT_STRING) { + unsigned long len_in_bits; // Protect against overflow during the bytes-to-bits conversion. if (len >= (ULONG_MAX >> 3) + 1) { PORT_SetError (SEC_ERROR_BAD_DER); state->top->status = decodeError; return 0; } - unsigned long len_in_bits = (len << 3) - state->bit_string_unused_bits; + len_in_bits = (len << 3) - state->bit_string_unused_bits; // Protect against overflow when computing the total length in bits. if (UINT_MAX - item->len < len_in_bits) { PORT_SetError (SEC_ERROR_BAD_DER); |