Skip to content

Commit 64fe26f

Browse files
committed
Backported CORE-6501: Segfault when shutting down database which got encrypted by another process
1 parent 83d0c1c commit 64fe26f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/jrd/CryptoManager.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,9 @@ namespace Jrd {
365365
crypt = hdr->hdr_flags & Ods::hdr_encrypted;
366366
process = hdr->hdr_flags & Ods::hdr_crypt_process;
367367

368-
if ((crypt || process) && !cryptPlugin)
368+
// tdbb w/o attachment comes when database is shutting down in the end of detachDatabase()
369+
// the only needed here page is header, i.e. we can live w/o cryptPlugin
370+
if ((crypt || process) && (!cryptPlugin) && tdbb->getAttachment())
369371
{
370372
ClumpletWriter hc(ClumpletWriter::UnTagged, hdr->hdr_page_size);
371373
hdr.getClumplets(hc);
@@ -388,7 +390,7 @@ namespace Jrd {
388390
hash = valid;
389391
}
390392

391-
if (flags & CRYPT_HDR_INIT)
393+
if (cryptPlugin && (flags & CRYPT_HDR_INIT))
392394
checkDigitalSignature(tdbb, hdr);
393395
}
394396

0 commit comments

Comments
 (0)