Don't reject a cert request with an empty list of CA cert names.

Don't crash with an empty CA name list.
This commit is contained in:
nelsonb%netscape.com 2002-11-16 03:19:48 +00:00
Родитель dc951d3cd1
Коммит 6b4fae5a4a
2 изменённых файлов: 7 добавлений и 4 удалений

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

@ -32,7 +32,7 @@
* may use your version of this file under either the MPL or the
* GPL.
*
* $Id: cmpcert.c,v 1.1 2000/03/31 19:31:24 relyea%netscape.com Exp $
* $Id: cmpcert.c,v 1.2 2002/11/16 03:19:47 nelsonb%netscape.com Exp $
*/
#include <stdio.h>
@ -64,7 +64,10 @@ NSS_CmpCertChainWCANames(CERTCertificate *cert, CERTDistNames *caNames)
SECStatus rv;
SECItem issuerName;
SECItem compatIssuerName;
if (!cert || !caNames || !caNames->nnames || !caNames->names ||
!caNames->names->data)
return SECFailure;
depth=0;
curcert = CERT_DupCertificate(cert);

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

@ -33,7 +33,7 @@
* may use your version of this file under either the MPL or the
* GPL.
*
* $Id: ssl3con.c,v 1.43 2002/11/05 00:25:19 nelsonb%netscape.com Exp $
* $Id: ssl3con.c,v 1.44 2002/11/16 03:19:48 nelsonb%netscape.com Exp $
*/
#include "nssrenam.h"
@ -4549,7 +4549,7 @@ ssl3_HandleCertificateRequest(sslSocket *ss, SSL3Opaque *b, PRUint32 length)
ca_list.nnames = nnames;
ca_list.names = (SECItem*)PORT_ArenaAlloc(arena, nnames * sizeof(SECItem));
if (ca_list.names == NULL)
if (nnames > 0 && ca_list.names == NULL)
goto no_mem;
for(i = 0, node = (dnameNode*)ca_list.head;