summaryrefslogtreecommitdiff
path: root/security/nss/lib/util
diff options
context:
space:
mode:
authorjpierre%netscape.com <devnull@localhost>2002-08-16 00:05:55 +0000
committerjpierre%netscape.com <devnull@localhost>2002-08-16 00:05:55 +0000
commitea8a5fd53be989cf43c51f745c20543527b886af (patch)
treeca49da3f6de57173179e27215db686ad93265ea6 /security/nss/lib/util
parent8732e39e907f6566d3caa691ff99623c639e9c29 (diff)
downloadnss-hg-ea8a5fd53be989cf43c51f745c20543527b886af.tar.gz
Correctly count the number of items in a SEQUENCE OF or SET OF in quickder decoder. Bug found by one of Terry's tests.
Diffstat (limited to 'security/nss/lib/util')
-rw-r--r--security/nss/lib/util/quickder.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/security/nss/lib/util/quickder.c b/security/nss/lib/util/quickder.c
index 82c158113..32c47ed89 100644
--- a/security/nss/lib/util/quickder.c
+++ b/security/nss/lib/util/quickder.c
@@ -541,8 +541,8 @@ static SECStatus DecodeGroup(void* dest,
do
{
SECItem anitem;
- rv = GetItem(&counter, &anitem, PR_FALSE);
- if (SECSuccess == rv)
+ rv = GetItem(&counter, &anitem, PR_TRUE);
+ if (SECSuccess == rv && (anitem.len) )
{
totalEntries++;
}
@@ -582,7 +582,11 @@ static SECStatus DecodeGroup(void* dest,
if (SECSuccess == rv && totalEntries)
do
{
- PR_ASSERT(entryIndex<totalEntries);
+ if (!(entryIndex<totalEntries))
+ {
+ rv = SECFailure;
+ break;
+ }
rv = DecodeItem(entries[entryIndex++], subTemplate, &group, arena, PR_TRUE);
} while ( (SECSuccess == rv) && (group.len) );
/* we should be at the end of the set by now */