4
0
mirror of https://github.com/QuasarApp/pe-parse.git synced 2025-05-08 01:29:34 +00:00

parse: Fix unsafe cast ()

* parse: Fix unsafe cast

* parse: Fix uninitialized warning

This is a false positive from cl.exe's /W4: We only
use this variable in a branch where it ends up initialized.
This commit is contained in:
William Woodruff 2019-10-24 01:15:56 -04:00 committed by GitHub
parent 40987e1f7e
commit 67a09499bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -126,7 +126,9 @@ struct parsed_pe_internal {
// The mapping of Rich header product id / build number pairs
// to strings
static const std::map<ProductKey, const std::string> ProductMap = {
{std::make_pair(1, 0), "Imported Functions"}};
{std::make_pair(static_cast<std::uint16_t>(1),
static_cast<std::uint16_t>(0)),
"Imported Functions"}};
static const std::string kUnknownProduct = "<unknown>";
@ -939,7 +941,7 @@ bool getHeader(bounded_buffer *file, pe_header &p, bounded_buffer *&rem) {
// read rich header
std::uint32_t dword;
std::uint32_t rich_end_signature_offset;
std::uint32_t rich_end_signature_offset = 0;
std::uint32_t xor_key;
bool found_rich = false;