We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bc9f639 commit 1e0f4fcCopy full SHA for 1e0f4fc
src/uthenticode.cpp
@@ -409,15 +409,15 @@ std::vector<WinCert> read_certs(peparse::parsed_pe *pe) {
409
offset += sizeof(type);
410
411
// Continue only we can satisfy the length
412
- if (current_wincert + length <= past_secdir) {
+ if (current_wincert + length <= past_secdir && length > offset) {
413
std::vector<std::uint8_t> cert_data(current_wincert + offset, current_wincert + length);
414
415
certs.emplace_back(static_cast<certificate_revision>(revision),
416
static_cast<certificate_type>(type),
417
cert_data);
418
}
419
420
- current_wincert += round(length, 8);
+ current_wincert += std::max<std::size_t>(round(length, 8), 8);
421
422
423
return certs;
0 commit comments