diff --git a/security/manager/ssl/src/nsCrypto.cpp b/security/manager/ssl/src/nsCrypto.cpp index f1c11bb07e16..d08895013a8c 100644 --- a/security/manager/ssl/src/nsCrypto.cpp +++ b/security/manager/ssl/src/nsCrypto.cpp @@ -696,6 +696,10 @@ cryptojs_generateOneKeyPair(JSContext *cx, nsKeyPairInfo *keyPairInfo, (params) ? strlen(params):0, keySize, keyPairInfo); + if (!keyGenParams) { + return NS_ERROR_INVALID_ARG; + } + // Make sure the token has password already set on it before trying // to generate the key.