summaryrefslogtreecommitdiffstats
path: root/security/nss/lib/util/quickder.c
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-07-18 15:58:00 +0200
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-07-18 15:58:00 +0200
commit2539ce925195a9524521c5d87fd3441d964d03d3 (patch)
tree00fd2cf658129d6c30e1dbb4f9c54d83321157db /security/nss/lib/util/quickder.c
parentca0083022fad1f9fb2a7b1d4b94f32402026e3e6 (diff)
parent89bd45bf91e0611449a93cbc978bdd6654109c46 (diff)
downloadUXP-2539ce925195a9524521c5d87fd3441d964d03d3.tar
UXP-2539ce925195a9524521c5d87fd3441d964d03d3.tar.gz
UXP-2539ce925195a9524521c5d87fd3441d964d03d3.tar.lz
UXP-2539ce925195a9524521c5d87fd3441d964d03d3.tar.xz
UXP-2539ce925195a9524521c5d87fd3441d964d03d3.zip
Merge branch 'nss-work'
Diffstat (limited to 'security/nss/lib/util/quickder.c')
-rw-r--r--security/nss/lib/util/quickder.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/security/nss/lib/util/quickder.c b/security/nss/lib/util/quickder.c
index 7a6ac1c53..70ae42b27 100644
--- a/security/nss/lib/util/quickder.c
+++ b/security/nss/lib/util/quickder.c
@@ -757,6 +757,13 @@ DecodeItem(void* dest,
}
case SEC_ASN1_BIT_STRING: {
+ /* Can't be 8 or more spare bits, or any spare bits
+ * if there are no octets. */
+ if (temp.data[0] >= 8 || (temp.data[0] > 0 && temp.len == 1)) {
+ PORT_SetError(SEC_ERROR_BAD_DER);
+ rv = SECFailure;
+ break;
+ }
/* change the length in the SECItem to be the number
of bits */
temp.len = (temp.len - 1) * 8 - (temp.data[0] & 0x7);