Skip to content

Commit

Permalink
Vulnerable map function is not called on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
wiredfool committed Oct 3, 2016
1 parent 6ce889a commit 98101c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion PIL/ImageFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def load(self):
if d == "raw" and a[0] == self.mode and a[0] in Image._MAPMODES:
try:
if hasattr(Image.core, "map"):
# use built-in mapper
# use built-in mapper WIN32 only
self.map = Image.core.map(self.filename)
self.map.seek(o)
self.im = self.map.readimage(
Expand Down
3 changes: 3 additions & 0 deletions Tests/test_map.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
from helper import PillowTestCase, unittest
import sys

from PIL import Image


@unittest.skipIf(sys.platform.startswith('win32'), "Win32 does not call map_buffer")
class TestMap(PillowTestCase):
def test_overflow(self):
# There is the potential to overflow comparisons in map.c
Expand Down

0 comments on commit 98101c0

Please sign in to comment.