Skip to content

Commit 0ce2454

Browse files
committed
Merge pull request #24 from Fr0sT-Brutal/patch-1
Zero the memory allocated in the heap
2 parents dc173ca + 89e02fc commit 0ce2454

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

MemoryModule.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -496,17 +496,14 @@ HMEMORYMODULE MemoryLoadLibraryEx(const void *data,
496496
}
497497
}
498498

499-
result = (PMEMORYMODULE)HeapAlloc(GetProcessHeap(), 0, sizeof(MEMORYMODULE));
499+
result = (PMEMORYMODULE)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MEMORYMODULE));
500500
if (result == NULL) {
501501
SetLastError(ERROR_OUTOFMEMORY);
502502
VirtualFree(code, 0, MEM_RELEASE);
503503
return NULL;
504504
}
505505

506506
result->codeBase = code;
507-
result->numModules = 0;
508-
result->modules = NULL;
509-
result->initialized = FALSE;
510507
result->isDLL = (old_header->FileHeader.Characteristics & IMAGE_FILE_DLL) != 0;
511508
result->loadLibrary = loadLibrary;
512509
result->getProcAddress = getProcAddress;

0 commit comments

Comments
 (0)