From 63d54706be598391c3a4f580e44c5c0b2a832a03 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Jun 25 2020 21:25:25 +0000 Subject: Don't allow unitialized value in a conditional If newcert is NULL then error is undefined (probably 0) which could lead to the code thinking the certificate imported. If the certificate wasn't decoded then set error to SECFailure --- diff --git a/src/certsave-n.c b/src/certsave-n.c index 3518def..237f4f8 100644 --- a/src/certsave-n.c +++ b/src/certsave-n.c @@ -517,6 +517,8 @@ cm_certsave_n_main(int fd, struct cm_store_ca *ca, struct cm_store_entry *entry, CK_INVALID_HANDLE, entry->cm_cert_nickname, PR_FALSE); + } else { + error = SECFailure; } if (error == SECSuccess) { cm_log(1, "Imported certificate with "