Fix bugzilla bug 261496. Absent OPTIONAL CHOICEs should not cause fatal

errors.  Fix printing code to not crash on missing optional nextUpdate.
r=julien.pierre
This commit is contained in:
nelsonb%netscape.com 2004-09-27 22:41:41 +00:00
Родитель 54e375ccfa
Коммит a099a58062
2 изменённых файлов: 5 добавлений и 3 удалений

Просмотреть файл

@ -2486,7 +2486,8 @@ SECU_PrintCRLInfo(FILE *out, CERTCrl *crl, char *m, int level)
level + 1);
SECU_PrintName(out, &(crl->name), "Issuer", level + 1);
SECU_PrintTimeChoice(out, &(crl->lastUpdate), "This Update", level + 1);
SECU_PrintTimeChoice(out, &(crl->nextUpdate), "Next Update", level + 1);
if (crl->nextUpdate.data && crl->nextUpdate.len) /* is optional */
SECU_PrintTimeChoice(out, &(crl->nextUpdate), "Next Update", level + 1);
if (crl->entries != NULL) {
iv = 0;

Просмотреть файл

@ -216,8 +216,9 @@ static SECStatus MatchComponentType(const SEC_ASN1Template* templateEntry,
return SECSuccess;
}
}
PORT_SetError(SEC_ERROR_BAD_DER);
return SECFailure;
/* no match, caller must decide if this is BAD DER, or not. */
*match = PR_FALSE;
return SECSuccess;
}
if (kind & SEC_ASN1_ANY)