Skip to content
This repository has been archived by the owner on Feb 20, 2021. It is now read-only.

Commit

Permalink
[PR] Fixed pointer overflow crash when using bgsave under rare circum…
Browse files Browse the repository at this point in the history
…stances.
  • Loading branch information
Harachie authored and enricogior committed Jun 21, 2016
1 parent ddb9987 commit 0707007
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Win32_Interop/Win32_Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ void EnsureMemoryIsMapped(const void *buffer, size_t size) {
if ((size_t) (pEnd - pStart) > Globals::pageSize) {
size_t offset = 0;
while (offset < size) {
if (size < offset) {
offset += Globals::pageSize;
if (offset > size) {
offset = size;
} else {
offset += Globals::pageSize;
}
c = *((char*) (p + offset));
}
Expand Down

0 comments on commit 0707007

Please sign in to comment.