Skip to content

Commit

Permalink
Merge branch 'bugfix/sentinel-sigint-crash' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
tporadowski committed Jun 17, 2020
2 parents 7f7bbed + 7ce82ac commit 3bf92ad
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Win32_Interop/Win32_Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ namespace Globals
/* This function is used to force the VEH on the entire size of the buffer length,
* in the event that the buffer crosses the memory page boundaries */
void EnsureMemoryIsMapped(const void *buffer, size_t size) {
//[tporadowski/#62] when this is called from main process - Globals::pageSize is not initialized,
// so prevent EXCEPTION_INT_DIVIDE_BY_ZERO
if (Globals::pageSize == 0) {
return;
}

char* pFirstByte = (char*) buffer;
char* pLastByte = (char*) buffer + size - 1;
char* pFirstPage = pFirstByte - ((size_t) pFirstByte % Globals::pageSize);
Expand Down

0 comments on commit 3bf92ad

Please sign in to comment.