mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-14 05:36:48 +03:00
Vulnerable map function is not called on windows
This commit is contained in:
parent
aa8cfce94c
commit
22ff3f4358
|
@ -154,7 +154,7 @@ class ImageFile(Image.Image):
|
||||||
if d == "raw" and a[0] == self.mode and a[0] in Image._MAPMODES:
|
if d == "raw" and a[0] == self.mode and a[0] in Image._MAPMODES:
|
||||||
try:
|
try:
|
||||||
if hasattr(Image.core, "map"):
|
if hasattr(Image.core, "map"):
|
||||||
# use built-in mapper
|
# use built-in mapper WIN32 only
|
||||||
self.map = Image.core.map(self.filename)
|
self.map = Image.core.map(self.filename)
|
||||||
self.map.seek(o)
|
self.map.seek(o)
|
||||||
self.im = self.map.readimage(
|
self.im = self.map.readimage(
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
from helper import PillowTestCase, unittest
|
from helper import PillowTestCase, unittest
|
||||||
|
import sys
|
||||||
|
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
|
||||||
|
|
||||||
|
@unittest.skipIf(sys.platform.startswith('win32'), "Win32 does not call map_buffer")
|
||||||
class TestMap(PillowTestCase):
|
class TestMap(PillowTestCase):
|
||||||
def test_overflow(self):
|
def test_overflow(self):
|
||||||
# There is the potential to overflow comparisons in map.c
|
# There is the potential to overflow comparisons in map.c
|
||||||
|
|
Loading…
Reference in New Issue
Block a user