зеркало из https://github.com/mozilla/gecko-dev.git
341291: Coverity 689 - potential NULL ptr crash in ssl3_SendCertificate. r=nelson
This commit is contained in:
Родитель
4d331091de
Коммит
9ea0404651
|
@ -39,7 +39,7 @@
|
|||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
/* $Id: ssl3con.c,v 1.92 2006/06/26 23:32:19 wtchang%redhat.com Exp $ */
|
||||
/* $Id: ssl3con.c,v 1.93 2006/07/17 22:08:03 alexei.volkov.bugs%sun.com Exp $ */
|
||||
|
||||
#include "nssrenam.h"
|
||||
#include "cert.h"
|
||||
|
@ -6783,23 +6783,25 @@ ssl3_SendCertificate(sslSocket *ss)
|
|||
if (rv != SECSuccess) {
|
||||
return rv; /* err set by AppendHandshake. */
|
||||
}
|
||||
for (i = 0; i < certChain->len; i++) {
|
||||
if (certChain) {
|
||||
for (i = 0; i < certChain->len; i++) {
|
||||
#ifdef NISCC_TEST
|
||||
if (fakeCert.len > 0 && i == ndex) {
|
||||
rv = ssl3_AppendHandshakeVariable(ss, fakeCert.data, fakeCert.len,
|
||||
3);
|
||||
SECITEM_FreeItem(&fakeCert, PR_FALSE);
|
||||
} else {
|
||||
rv = ssl3_AppendHandshakeVariable(ss, certChain->certs[i].data,
|
||||
certChain->certs[i].len, 3);
|
||||
}
|
||||
if (fakeCert.len > 0 && i == ndex) {
|
||||
rv = ssl3_AppendHandshakeVariable(ss, fakeCert.data,
|
||||
fakeCert.len, 3);
|
||||
SECITEM_FreeItem(&fakeCert, PR_FALSE);
|
||||
} else {
|
||||
rv = ssl3_AppendHandshakeVariable(ss, certChain->certs[i].data,
|
||||
certChain->certs[i].len, 3);
|
||||
}
|
||||
#else
|
||||
rv = ssl3_AppendHandshakeVariable(ss, certChain->certs[i].data,
|
||||
certChain->certs[i].len, 3);
|
||||
rv = ssl3_AppendHandshakeVariable(ss, certChain->certs[i].data,
|
||||
certChain->certs[i].len, 3);
|
||||
#endif
|
||||
if (rv != SECSuccess) {
|
||||
return rv; /* err set by AppendHandshake. */
|
||||
}
|
||||
if (rv != SECSuccess) {
|
||||
return rv; /* err set by AppendHandshake. */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return SECSuccess;
|
||||
|
|
Загрузка…
Ссылка в новой задаче