Skip to content

Commit

Permalink
Merge pull request fancycode#24 from Fr0sT-Brutal/patch-1
Browse files Browse the repository at this point in the history
Zero the memory allocated in the heap
  • Loading branch information
fancycode committed Mar 13, 2015
2 parents dc173ca + 89e02fc commit 0ce2454
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions MemoryModule.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,17 +496,14 @@ HMEMORYMODULE MemoryLoadLibraryEx(const void *data,
}
}

result = (PMEMORYMODULE)HeapAlloc(GetProcessHeap(), 0, sizeof(MEMORYMODULE));
result = (PMEMORYMODULE)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MEMORYMODULE));
if (result == NULL) {
SetLastError(ERROR_OUTOFMEMORY);
VirtualFree(code, 0, MEM_RELEASE);
return NULL;
}

result->codeBase = code;
result->numModules = 0;
result->modules = NULL;
result->initialized = FALSE;
result->isDLL = (old_header->FileHeader.Characteristics & IMAGE_FILE_DLL) != 0;
result->loadLibrary = loadLibrary;
result->getProcAddress = getProcAddress;
Expand Down

0 comments on commit 0ce2454

Please sign in to comment.