diff options
author | Cykesiopka <cykesiopka.bmo@gmail.com> | 2015-02-26 00:24:37 +0100 |
---|---|---|
committer | Cykesiopka <cykesiopka.bmo@gmail.com> | 2015-02-26 00:24:37 +0100 |
commit | 9880e8739be02ee1f6643780bd07d7e7c21c7212 (patch) | |
tree | f9c918420ea02caf1c80e3a913f09f891418a998 | |
parent | c66044cb52f461ebec7ec6e0e89fad3f8b69eb84 (diff) | |
download | nss-hg-9880e8739be02ee1f6643780bd07d7e7c21c7212.tar.gz |
Bug 1061725 - Fix CERT_DecodeTrustString() to call PORT_SetError() if trust string is invalid. r=emaldonaNSS_3_18_BETA7
-rw-r--r-- | lib/certdb/certdb.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/certdb/certdb.c b/lib/certdb/certdb.c index 1d18c5c33..2581be227 100644 --- a/lib/certdb/certdb.c +++ b/lib/certdb/certdb.c @@ -2316,7 +2316,7 @@ CERT_DecodeTrustString(CERTCertTrust *trust, const char *trusts) { unsigned int i; unsigned int *pflags; - + if (!trust) { PORT_SetError(SEC_ERROR_INVALID_ARGS); return SECFailure; @@ -2330,7 +2330,7 @@ CERT_DecodeTrustString(CERTCertTrust *trust, const char *trusts) } pflags = &trust->sslFlags; - + for (i=0; i < PORT_Strlen(trusts); i++) { switch (trusts[i]) { case 'p': @@ -2376,6 +2376,7 @@ CERT_DecodeTrustString(CERTCertTrust *trust, const char *trusts) } break; default: + PORT_SetError(SEC_ERROR_INVALID_ARGS); return SECFailure; } } |