You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fileinfo does not crash when analyzing the files above.
Output from valgrind
Invalid read of size 8
at 0x2C1FDB: fileformat::PeFormat::verifySignature(pkcs7_st*) (pe_format.cpp:1215)
by 0x2C0F07: fileformat::PeFormat::loadCertificates() (pe_format.cpp:977)
by 0x2BD577: fileformat::PeFormat::initStructures() (pe_format.cpp:384)
by 0x2BCDC1: fileformat::PeFormat::PeFormat(...) (pe_format.cpp:295)
by 0x23AD36: fileinfo::PeWrapper::PeWrapper(...) (pe_wrapper.cpp:96)
by 0x1C3181: void __gnu_cxx::new_allocator<...>::construct<...>(...) (new_allocator.h:136)
by 0x1C303B: void std::allocator_traits<...>::construct<...>(...) (alloc_traits.h:475)
by 0x1C2E7E: std::_Sp_counted_ptr_inplace<...>::_Sp_counted_ptr_inplace<...>(...) (shared_ptr_base.h:526)
by 0x1C2BC6: std::__shared_count<...>::__shared_count<...>(...) (shared_ptr_base.h:637)
by 0x1C2A11: std::__shared_ptr<...>::__shared_ptr<...>(...) (shared_ptr_base.h:1295)
by 0x1C28D8: std::shared_ptr<...>::shared_ptr<...>(...) (shared_ptr.h:344)
by 0x1C2765: std::shared_ptr<...> std::allocate_shared<...>(...) (shared_ptr.h:691)
Address 0x6bc1bb8 is 24 bytes after a block of size 16 in arena "client"
…igner (#87).
In #87, a fileinfo crash is reported when verifying the digital signature of
attached PE files. What all the attached files have in common is that we are
unable to find a signer or counter-signer for them and p7->length is 0. As the
following comment in pe_format.cpp suggests, there is no point of continuing in
such a case:
// If we have no signer and countersigner, there must be something really bad
if(!signerCert && !counterSignerCert)
{
BIO_free(bio);
return;
}
Thus, move the signature verification AFTER the check that we have found a
signer or a counter-signer. This fixes the signature-verifying crashes for all
the files attached to #87.
fileinfo
crashes when verifying digital signature of attached PE files.Input
where
FILE
is any of the PE files below:Output
Expected output
fileinfo
does not crash when analyzing the files above.Output from valgrind
Configuration
master
)The text was updated successfully, but these errors were encountered: