Vulnerable map function is not called on windows

This commit is contained in:
wiredfool 2016-10-03 07:42:48 -07:00
parent aa8cfce94c
commit 22ff3f4358
2 changed files with 4 additions and 1 deletions

View File

@ -154,7 +154,7 @@ class ImageFile(Image.Image):
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(

View File

@ -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