summaryrefslogtreecommitdiffstats
path: root/security/nss/lib/certdb/alg1485.c
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-28 07:38:20 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-28 07:38:20 +0200
commit6b2bba06b433fb75979ab6daf7bbe8bc76c53875 (patch)
tree75803b4683889e6e0d2a3faef30415db3ff7b3ba /security/nss/lib/certdb/alg1485.c
parent72def35cd0cf3649b6d7ab72b66117df3e1c33fc (diff)
parentc75dae3ed21bfa5a8ae46cd83d18329af5bea05a (diff)
downloadUXP-6b2bba06b433fb75979ab6daf7bbe8bc76c53875.tar
UXP-6b2bba06b433fb75979ab6daf7bbe8bc76c53875.tar.gz
UXP-6b2bba06b433fb75979ab6daf7bbe8bc76c53875.tar.lz
UXP-6b2bba06b433fb75979ab6daf7bbe8bc76c53875.tar.xz
UXP-6b2bba06b433fb75979ab6daf7bbe8bc76c53875.zip
Merge branch 'master' of https://github.com/MoonchildProductions/UXP into pm_url_1
Diffstat (limited to 'security/nss/lib/certdb/alg1485.c')
-rw-r--r--security/nss/lib/certdb/alg1485.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/security/nss/lib/certdb/alg1485.c b/security/nss/lib/certdb/alg1485.c
index 9a69c5bc5..38b2fe4b5 100644
--- a/security/nss/lib/certdb/alg1485.c
+++ b/security/nss/lib/certdb/alg1485.c
@@ -703,19 +703,14 @@ CERT_GetOidString(const SECItem* oid)
return NULL;
}
- /* If the OID has length 1, we bail. */
- if (oid->len < 2) {
- return NULL;
- }
-
/* first will point to the next sequence of bytes to decode */
first = (PRUint8*)oid->data;
/* stop points to one past the legitimate data */
stop = &first[oid->len];
/*
- * Check for our pseudo-encoded single-digit OIDs
- */
+ * Check for our pseudo-encoded single-digit OIDs
+ */
if ((*first == 0x80) && (2 == oid->len)) {
/* Funky encoding. The second byte is the number */
rvString = PR_smprintf("%lu", (PRUint32)first[1]);
@@ -733,10 +728,6 @@ CERT_GetOidString(const SECItem* oid)
break;
}
}
- /* There's no first bit set, so this isn't valid. Bail.*/
- if (last == stop) {
- goto unsupported;
- }
bytesBeforeLast = (unsigned int)(last - first);
if (bytesBeforeLast <= 3U) { /* 0-28 bit number */
PRUint32 n = 0;
@@ -757,12 +748,12 @@ CERT_GetOidString(const SECItem* oid)
CASE(2, 0x7f);
CASE(1, 0x7f);
case 0:
- n |= last[0] & 0x7f;
+ n |=
+ last[0] & 0x7f;
break;
}
- if (last[0] & 0x80) {
+ if (last[0] & 0x80)
goto unsupported;
- }
if (!rvString) {
/* This is the first number.. decompose it */
@@ -1314,7 +1305,8 @@ CERT_GetCertificateEmailAddress(CERTCertificate* cert)
}
} else if (current->type == certRFC822Name) {
rawEmailAddr =
- (char*)PORT_ArenaZAlloc(cert->arena, current->name.other.len + 1);
+ (char*)PORT_ArenaZAlloc(cert->arena, current->name.other.len +
+ 1);
if (!rawEmailAddr) {
goto finish;
}