mirror of
https://github.com/chris2511/xca.git
synced 2026-09-13 18:46:25 +05:00
Fix a use-after-free crash
When requesting revocation AND deletion of certificates while renewing them, revocation occurs after deletion, causing a use-after-free error/crash. This commit delays the certificates deletion after they have been revoked.
This commit is contained in:
parent
89b3914ff7
commit
5dc8e7fd34
@ -765,13 +765,15 @@ void db_x509::certRenewal(QModelIndexList indexes)
|
||||
newcert->sign(signkey, oldcert->getDigest());
|
||||
newcert = dynamic_cast<pki_x509 *>(insert(newcert));
|
||||
createSuccess(newcert);
|
||||
|
||||
// delete old certificate if requested
|
||||
if (doReplace)
|
||||
deletePKI(idx);
|
||||
}
|
||||
if (doRevoke)
|
||||
do_revoke(indexes, r);
|
||||
|
||||
// delete old certificates if requested
|
||||
if (doReplace)
|
||||
foreach(idx, indexes)
|
||||
if (fromIndex<pki_x509>(idx))
|
||||
deletePKI(idx);
|
||||
}
|
||||
catch (errorEx &err) {
|
||||
XCA_ERROR(err);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user