X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/79b9da22a1f4b26279940d285c1bc28ce4e99252..0d4552ce43ff8bf2e8666a9c5c44c3590eb117a8:/OSX/libsecurity_codesigning/lib/signerutils.cpp?ds=sidebyside diff --git a/OSX/libsecurity_codesigning/lib/signerutils.cpp b/OSX/libsecurity_codesigning/lib/signerutils.cpp index ec0cf483..f6da5e93 100644 --- a/OSX/libsecurity_codesigning/lib/signerutils.cpp +++ b/OSX/libsecurity_codesigning/lib/signerutils.cpp @@ -262,7 +262,11 @@ void MachOEditor::reset(Arch &arch) for (auto type = mHashTypes.begin(); type != mHashTypes.end(); ++type) { arch.eachDigest(^(CodeDirectory::Builder& builder) { - builder.reopen(tempPath, arch.source->offset(), arch.source->signingOffset()); + /* Signature editing may have no need for cd builders, and not + * have opened them, so only reopen them conditionally. */ + if (builder.opened()) { + builder.reopen(tempPath, arch.source->offset(), arch.source->signingOffset()); + } }); } }