Skip to content

Commit c425662

Browse files
committed
fix(PE): uninitialized module name VA
1 parent 929b031 commit c425662

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

mz/pe/dirs/imports.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ bool pe_imports_read(RDContext* ctx, const PEFormat* pe) {
154154
rd_reader_save(r);
155155
rd_library_type(ctx, va, "PE_IMPORT_DESCRIPTOR", 0, RD_TYPE_NONE);
156156

157-
RDAddress name_va;
158157
char* mod = rd_strdup(pe_imports_get_descriptor_name(r, pe, &desc));
159158

160159
if(mod) {
@@ -169,8 +168,11 @@ bool pe_imports_read(RDContext* ctx, const PEFormat* pe) {
169168

170169
rd_free(import_stem);
171170

172-
rd_library_type(ctx, name_va, "char", strlen(mod) + 1,
173-
RD_TYPE_NONE);
171+
RDAddress name_va;
172+
if(pe_from_rva(pe, desc.Name, &name_va)) {
173+
rd_library_type(ctx, name_va, "char", strlen(mod) + 1,
174+
RD_TYPE_NONE);
175+
}
174176

175177
RDAddress ft_va, oft_va;
176178
bool has_ft = pe_from_rva(pe, desc.FirstThunk, &ft_va);

0 commit comments

Comments
 (0)