8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 04:03:03 +01:00

Backported CORE-6501: Segfault when shutting down database which got encrypted by another process

This commit is contained in:
AlexPeshkoff 2021-03-03 18:56:12 +03:00
parent 83d0c1c92e
commit 64fe26fb10

View File

@ -365,7 +365,9 @@ namespace Jrd {
crypt = hdr->hdr_flags & Ods::hdr_encrypted;
process = hdr->hdr_flags & Ods::hdr_crypt_process;
if ((crypt || process) && !cryptPlugin)
// tdbb w/o attachment comes when database is shutting down in the end of detachDatabase()
// the only needed here page is header, i.e. we can live w/o cryptPlugin
if ((crypt || process) && (!cryptPlugin) && tdbb->getAttachment())
{
ClumpletWriter hc(ClumpletWriter::UnTagged, hdr->hdr_page_size);
hdr.getClumplets(hc);
@ -388,7 +390,7 @@ namespace Jrd {
hash = valid;
}
if (flags & CRYPT_HDR_INIT)
if (cryptPlugin && (flags & CRYPT_HDR_INIT))
checkDigitalSignature(tdbb, hdr);
}