Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
30529a0279 | ||
|
|
5efeed7766 | ||
|
|
b8d4895bd5 | ||
|
|
bd7e6b868f | ||
|
|
4e9f367dfd |
@ -10,7 +10,7 @@ python:
|
|||||||
- 3.2
|
- 3.2
|
||||||
- 3.3
|
- 3.3
|
||||||
|
|
||||||
install: "sudo apt-get -qq install libfreetype6-dev liblcms2-dev libwebp-dev python-qt4 ghostscript""
|
install: "sudo apt-get -qq install libfreetype6-dev liblcms2-dev libwebp-dev python-qt4 ghostscript"
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- python setup.py clean
|
- python setup.py clean
|
||||||
|
|||||||
11
CHANGES.rst
11
CHANGES.rst
@ -1,6 +1,17 @@
|
|||||||
Changelog (Pillow)
|
Changelog (Pillow)
|
||||||
==================
|
==================
|
||||||
|
|
||||||
|
2.3.2 (2014-08-13)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
- Fixed CVE-2014-3589, a DOS in the IcnsImagePlugin
|
||||||
|
[Andrew Drake]
|
||||||
|
|
||||||
|
2.3.1 (2014-03-14)
|
||||||
|
------------------
|
||||||
|
- Fix insecure use of tempfile.mktemp (CVE-2014-1932 CVE-2014-1933)
|
||||||
|
[wiredfool]
|
||||||
|
|
||||||
2.3.0 (2014-01-01)
|
2.3.0 (2014-01-01)
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
|
|||||||
@ -67,7 +67,8 @@ def Ghostscript(tile, size, fp, scale=1):
|
|||||||
|
|
||||||
import tempfile, os, subprocess
|
import tempfile, os, subprocess
|
||||||
|
|
||||||
file = tempfile.mktemp()
|
out_fd, file = tempfile.mkstemp()
|
||||||
|
os.close(out_fd)
|
||||||
|
|
||||||
# Build ghostscript command
|
# Build ghostscript command
|
||||||
command = ["gs",
|
command = ["gs",
|
||||||
|
|||||||
@ -120,6 +120,8 @@ class IcnsFile:
|
|||||||
i = HEADERSIZE
|
i = HEADERSIZE
|
||||||
while i < filesize:
|
while i < filesize:
|
||||||
sig, blocksize = nextheader(fobj)
|
sig, blocksize = nextheader(fobj)
|
||||||
|
if blocksize <= 0:
|
||||||
|
raise SyntaxError('invalid block header')
|
||||||
i = i + HEADERSIZE
|
i = i + HEADERSIZE
|
||||||
blocksize = blocksize - HEADERSIZE
|
blocksize = blocksize - HEADERSIZE
|
||||||
dct[sig] = (i, blocksize)
|
dct[sig] = (i, blocksize)
|
||||||
|
|||||||
@ -495,14 +495,17 @@ class Image:
|
|||||||
self.readonly = 0
|
self.readonly = 0
|
||||||
|
|
||||||
def _dump(self, file=None, format=None):
|
def _dump(self, file=None, format=None):
|
||||||
import tempfile
|
import tempfile, os
|
||||||
if not file:
|
if not file:
|
||||||
file = tempfile.mktemp()
|
f, file = tempfile.mkstemp(format or '')
|
||||||
|
os.close(f)
|
||||||
|
|
||||||
self.load()
|
self.load()
|
||||||
if not format or format == "PPM":
|
if not format or format == "PPM":
|
||||||
self.im.save_ppm(file)
|
self.im.save_ppm(file)
|
||||||
else:
|
else:
|
||||||
file = file + "." + format
|
if file.endswith(format):
|
||||||
|
file = file + "." + format
|
||||||
self.save(file, format)
|
self.save(file, format)
|
||||||
return file
|
return file
|
||||||
|
|
||||||
|
|||||||
@ -172,8 +172,8 @@ class IptcImageFile(ImageFile.ImageFile):
|
|||||||
self.fp.seek(offset)
|
self.fp.seek(offset)
|
||||||
|
|
||||||
# Copy image data to temporary file
|
# Copy image data to temporary file
|
||||||
outfile = tempfile.mktemp()
|
o_fd, outfile = tempfile.mkstemp(text=False)
|
||||||
o = open(outfile, "wb")
|
o = os.fdopen(o_fd)
|
||||||
if encoding == "raw":
|
if encoding == "raw":
|
||||||
# To simplify access to the extracted file,
|
# To simplify access to the extracted file,
|
||||||
# prepend a PPM header
|
# prepend a PPM header
|
||||||
|
|||||||
@ -344,13 +344,17 @@ class JpegImageFile(ImageFile.ImageFile):
|
|||||||
# ALTERNATIVE: handle JPEGs via the IJG command line utilities
|
# ALTERNATIVE: handle JPEGs via the IJG command line utilities
|
||||||
|
|
||||||
import tempfile, os
|
import tempfile, os
|
||||||
file = tempfile.mktemp()
|
f, path = tempfile.mkstemp()
|
||||||
os.system("djpeg %s >%s" % (self.filename, file))
|
os.close(f)
|
||||||
|
if os.path.exists(self.filename):
|
||||||
|
os.system("djpeg '%s' >'%s'" % (self.filename, path))
|
||||||
|
else:
|
||||||
|
raise ValueError("Invalid Filename")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.im = Image.core.open_ppm(file)
|
self.im = Image.core.open_ppm(path)
|
||||||
finally:
|
finally:
|
||||||
try: os.unlink(file)
|
try: os.unlink(path)
|
||||||
except: pass
|
except: pass
|
||||||
|
|
||||||
self.mode = self.im.mode
|
self.mode = self.im.mode
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
# ;-)
|
# ;-)
|
||||||
|
|
||||||
VERSION = '1.1.7' # PIL version
|
VERSION = '1.1.7' # PIL version
|
||||||
PILLOW_VERSION = '2.3.0' # Pillow
|
PILLOW_VERSION = '2.3.2' # Pillow
|
||||||
|
|
||||||
_plugins = ['ArgImagePlugin',
|
_plugins = ['ArgImagePlugin',
|
||||||
'BmpImagePlugin',
|
'BmpImagePlugin',
|
||||||
|
|||||||
10
Tests/check_icns_dos.py
Normal file
10
Tests/check_icns_dos.py
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# Tests potential DOS of IcnsImagePlugin with 0 length block.
|
||||||
|
# Run from anywhere that PIL is importable.
|
||||||
|
|
||||||
|
from PIL import Image
|
||||||
|
from io import BytesIO
|
||||||
|
|
||||||
|
if bytes is str:
|
||||||
|
Image.open(BytesIO(bytes('icns\x00\x00\x00\x10hang\x00\x00\x00\x00')))
|
||||||
|
else:
|
||||||
|
Image.open(BytesIO(bytes('icns\x00\x00\x00\x10hang\x00\x00\x00\x00', 'latin-1')))
|
||||||
@ -71,7 +71,7 @@
|
|||||||
* See the README file for information on usage and redistribution.
|
* See the README file for information on usage and redistribution.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define PILLOW_VERSION "2.3.0"
|
#define PILLOW_VERSION "2.3.2"
|
||||||
|
|
||||||
#include "Python.h"
|
#include "Python.h"
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user