Skip to content

Commit 7f6df64

Browse files
risicleJonathan Ringer
authored andcommitted
python3Packages.pillow: add patches for CVE-2022-22815 CVE-2022-22816 CVE-2022-22817
1 parent 4bf9aa4 commit 7f6df64

2 files changed

Lines changed: 22 additions & 2 deletions

File tree

pkgs/development/python-modules/pillow/default.nix

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ lib, stdenv, buildPythonPackage, fetchPypi, isPyPy, isPy3k
1+
{ lib, stdenv, buildPythonPackage, fetchPypi, isPyPy, isPy3k, fetchpatch
22
, defusedxml, olefile, freetype, libjpeg, zlib, libtiff, libwebp, tcl, lcms2, tk, libX11
33
, libxcb, openjpeg, libimagequant, pyroma, numpy, pytestCheckHook
44
}@args:
@@ -14,6 +14,25 @@ import ./generic.nix (rec {
1414
sha256 = "1361y215ydmdh4il1vay5831aqivmpwgzjqrphqjdiq0ipnz7qyx";
1515
};
1616

17+
patches = [
18+
(fetchpatch {
19+
name = "CVE-2022-22815.patch";
20+
url = "https://github.com/python-pillow/Pillow/commit/1e092419b6806495c683043ab3feb6ce264f3b9c.patch";
21+
sha256 = "1mafa8ixh4a4nh98yjp7dhh68kk4sxbzjm468h9gjba0py8657rd";
22+
})
23+
(fetchpatch {
24+
name = "CVE-2022-22816.patch";
25+
url = "https://github.com/python-pillow/Pillow/commit/c48271ab354db49cdbd740bc45e13be4f0f7993c.patch";
26+
sha256 = "1jr25918lxqljswv1jc7m3nn370xrz0l7g39lbyh5ndjz1dmnpvv";
27+
})
28+
(fetchpatch {
29+
name = "CVE-2022-22817.patch";
30+
url = "https://github.com/python-pillow/Pillow/commit/8531b01d6cdf0b70f256f93092caa2a5d91afc11.patch";
31+
excludes = [ "docs/releasenotes/9.0.0.rst" ];
32+
sha256 = "13va7lmja9bkp1d8bnwpns9nh7p31kal89cvfky4r95lx0ckrnfv";
33+
})
34+
];
35+
1736
meta = with lib; {
1837
homepage = "https://python-pillow.org/";
1938
description = "The friendly PIL fork (Python Imaging Library)";

pkgs/development/python-modules/pillow/generic.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
, disabled
44
, src
55
, meta
6+
, patches ? []
67
, ...
78
}@args:
89

910
with args;
1011

1112
buildPythonPackage rec {
12-
inherit pname version src meta;
13+
inherit pname version src meta patches;
1314

1415
# Disable imagefont tests, because they don't work well with infinality:
1516
# https://github.com/python-pillow/Pillow/issues/1259

0 commit comments

Comments
 (0)