Bugfix: Do not use memset on non-POD structures

This commit is contained in:
Alessandro Gario 2017-10-21 19:45:25 +02:00
parent 0d0ca1861c
commit e632a37290
2 changed files with 4 additions and 2 deletions

View File

@ -363,8 +363,6 @@ bool parse_resource_table(bounded_buffer *sectionData,
}
resource rsrc;
memset(&rsrc, 0, sizeof(resource));
rsrc.type_str = rde->type_str;
rsrc.name_str = rde->name_str;
rsrc.lang_str = rde->lang_str;

View File

@ -82,6 +82,10 @@ typedef struct _bounded_buffer {
} bounded_buffer;
struct resource {
resource()
: type(0), name(0), lang(0), codepage(0), RVA(0), size(0), buf(nullptr) {
}
std::string type_str;
std::string name_str;
std::string lang_str;