Skip to content

Commit b168ec2

Browse files
committed
Replace dependency sphinx-issues with builtin sphinx.ext.extlinks
1 parent 2d5f451 commit b168ec2

File tree

19 files changed

+58
-50
lines changed

19 files changed

+58
-50
lines changed

docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ clean:
4545
-rm -rf $(BUILDDIR)/*
4646

4747
install-sphinx:
48-
$(PYTHON) -m pip install --quiet furo olefile sphinx sphinx-copybutton sphinx-inline-tabs sphinx-issues sphinx-removed-in sphinxext-opengraph
48+
$(PYTHON) -m pip install --quiet furo olefile sphinx sphinx-copybutton sphinx-inline-tabs sphinx-removed-in sphinxext-opengraph
4949

5050
.PHONY: html
5151
html:

docs/conf.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
extensions = [
3030
"sphinx.ext.autodoc",
3131
"sphinx.ext.intersphinx",
32+
"sphinx.ext.extlinks",
3233
"sphinx.ext.viewcode",
3334
"sphinx_copybutton",
3435
"sphinx_inline_tabs",
35-
"sphinx_issues",
3636
"sphinx_removed_in",
3737
"sphinxext.opengraph",
3838
]
@@ -317,8 +317,17 @@ def setup(app):
317317
app.add_css_file("css/dark.css")
318318

319319

320-
# GitHub repo for sphinx-issues
321-
issues_github_path = "python-pillow/Pillow"
320+
# sphinx.ext.extlinks
321+
# This config is a dictionary of external sites,
322+
# mapping unique short aliases to a base URL and a prefix.
323+
# https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html
324+
_repo = "https://github.com/python-pillow/Pillow/"
325+
extlinks = {
326+
"cve": ("https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-%s", "CVE-%s"),
327+
"cwe": ("https://cwe.mitre.org/data/definitions/%s.html", "CWE-%s"),
328+
"issue": (_repo + "issues/%s", "#%s"),
329+
"pr": (_repo + "pull/%s", "#%s"),
330+
}
322331

323332
# sphinxext.opengraph
324333
ogp_image = (

docs/deprecations.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ FreeType 2.7
261261
Support for FreeType 2.7 has been removed.
262262

263263
We recommend upgrading to at least `FreeType`_ 2.10.4, which fixed a severe
264-
vulnerability introduced in FreeType 2.6 (:cve:`CVE-2020-15999`).
264+
vulnerability introduced in FreeType 2.6 (:cve:`2020-15999`).
265265

266266
.. _FreeType: https://freetype.org/
267267

docs/releasenotes/3.1.1.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ CVE-2016-0740 -- Buffer overflow in TiffDecode.c
66
------------------------------------------------
77

88
Pillow 3.1.0 and earlier when linked against libtiff >= 4.0.0 on x64
9-
may overflow a buffer when reading a specially crafted tiff file (:cve:`CVE-2016-0740`).
9+
may overflow a buffer when reading a specially crafted tiff file (:cve:`2016-0740`).
1010

1111
Specifically, libtiff >= 4.0.0 changed the return type of
1212
``TIFFScanlineSize`` from ``int32`` to machine dependent
@@ -24,7 +24,7 @@ CVE-2016-0775 -- Buffer overflow in FliDecode.c
2424
-----------------------------------------------
2525

2626
In all versions of Pillow, dating back at least to the last PIL 1.1.7
27-
release, FliDecode.c has a buffer overflow error (:cve:`CVE-2016-0775`).
27+
release, FliDecode.c has a buffer overflow error (:cve:`2016-0775`).
2828

2929
Around line 192:
3030

@@ -53,7 +53,7 @@ CVE-2016-2533 -- Buffer overflow in PcdDecode.c
5353
-----------------------------------------------
5454

5555
In all versions of Pillow, dating back at least to the last PIL 1.1.7
56-
release, ``PcdDecode.c`` has a buffer overflow error (:cve:`CVE-2016-2533`).
56+
release, ``PcdDecode.c`` has a buffer overflow error (:cve:`2016-2533`).
5757

5858
The ``state.buffer`` for ``PcdDecode.c`` is allocated based on a 3
5959
bytes per pixel sizing, where ``PcdDecode.c`` wrote into the buffer

docs/releasenotes/3.1.2.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ CVE-2016-3076 -- Buffer overflow in Jpeg2KEncode.c
77

88
Pillow between 2.5.0 and 3.1.1 may overflow a buffer when writing
99
large Jpeg2000 files, allowing for code execution or other memory
10-
corruption (:cve:`CVE-2016-3076`).
10+
corruption (:cve:`2016-3076`).
1111

1212
This occurs specifically in the function ``j2k_encode_entry``, at the line:
1313

docs/releasenotes/6.2.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Security
6969
========
7070

7171
This release catches several buffer overruns, as well as addressing
72-
:cve:`CVE-2019-16865`. The CVE is regarding DOS problems, such as consuming large
72+
:cve:`2019-16865`. The CVE is regarding DOS problems, such as consuming large
7373
amounts of memory, or taking a large amount of time to process an image.
7474

7575
In RawDecode.c, an error is now thrown if skip is calculated to be less than

docs/releasenotes/6.2.2.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ Security
66

77
This release addresses several security problems.
88

9-
:cve:`CVE-2019-19911` is regarding FPX images. If an image reports that it has a large
9+
:cve:`2019-19911` is regarding FPX images. If an image reports that it has a large
1010
number of bands, a large amount of resources will be used when trying to process the
1111
image. This is fixed by limiting the number of bands to those usable by Pillow.
1212

13-
Buffer overruns were found when processing an SGI (:cve:`CVE-2020-5311`),
14-
PCX (:cve:`CVE-2020-5312`) or FLI image (:cve:`CVE-2020-5313`). Checks have been added
13+
Buffer overruns were found when processing an SGI (:cve:`2020-5311`),
14+
PCX (:cve:`2020-5312`) or FLI image (:cve:`2020-5313`). Checks have been added
1515
to prevent this.
1616

17-
:cve:`CVE-2020-5310`: Overflow checks have been added when calculating the size of a
17+
:cve:`2020-5310`: Overflow checks have been added when calculating the size of a
1818
memory block to be reallocated in the processing of a TIFF image.

docs/releasenotes/7.1.0.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ Security
7272

7373
This release includes security fixes.
7474

75-
* :cve:`CVE-2020-10177` Fix multiple out-of-bounds reads in FLI decoding
76-
* :cve:`CVE-2020-10378` Fix bounds overflow in PCX decoding
77-
* :cve:`CVE-2020-10379` Fix two buffer overflows in TIFF decoding
78-
* :cve:`CVE-2020-10994` Fix bounds overflow in JPEG 2000 decoding
79-
* :cve:`CVE-2020-11538` Fix buffer overflow in SGI-RLE decoding
75+
* :cve:`2020-10177` Fix multiple out-of-bounds reads in FLI decoding
76+
* :cve:`2020-10378` Fix bounds overflow in PCX decoding
77+
* :cve:`2020-10379` Fix two buffer overflows in TIFF decoding
78+
* :cve:`2020-10994` Fix bounds overflow in JPEG 2000 decoding
79+
* :cve:`2020-11538` Fix buffer overflow in SGI-RLE decoding
8080

8181
Other Changes
8282
=============

docs/releasenotes/8.0.1.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Security
55
========
66

7-
Update FreeType used in binary wheels to `2.10.4`_ to fix :cve:`CVE-2020-15999`:
7+
Update FreeType used in binary wheels to `2.10.4`_ to fix :cve:`2020-15999`:
88

99
- A heap buffer overflow has been found in the handling of embedded PNG bitmaps,
1010
introduced in FreeType version 2.6.

docs/releasenotes/8.1.0.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Support for FreeType 2.7 is deprecated and will be removed in Pillow 9.0.0 (2022
1111
when FreeType 2.8 will be the minimum supported.
1212

1313
We recommend upgrading to at least FreeType `2.10.4`_, which fixed a severe
14-
vulnerability introduced in FreeType 2.6 (:cve:`CVE-2020-15999`).
14+
vulnerability introduced in FreeType 2.6 (:cve:`2020-15999`).
1515

1616
.. _2.10.4: https://sourceforge.net/projects/freetype/files/freetype2/2.10.4/
1717

@@ -40,13 +40,13 @@ This release includes security fixes.
4040

4141
* An out-of-bounds read when saving TIFFs with custom metadata through LibTIFF
4242
* An out-of-bounds read when saving a GIF of 1px width
43-
* :cve:`CVE-2020-35653` Buffer read overrun in PCX decoding
43+
* :cve:`2020-35653` Buffer read overrun in PCX decoding
4444

4545
The PCX image decoder used the reported image stride to calculate the row buffer,
4646
rather than calculating it from the image size. This issue dates back to the PIL fork.
4747
Thanks to Google's `OSS-Fuzz`_ project for finding this.
4848

49-
* :cve:`CVE-2020-35654` Fix TIFF out-of-bounds write error
49+
* :cve:`2020-35654` Fix TIFF out-of-bounds write error
5050

5151
Out-of-bounds write in ``TiffDecode.c`` when reading corrupt YCbCr files in some
5252
LibTIFF versions (4.1.0/Ubuntu 20.04, but not 4.0.9/Ubuntu 18.04). In some cases
@@ -55,7 +55,7 @@ an out-of-bounds write in ``TiffDecode.c``. This potentially affects Pillow vers
5555
from 6.0.0 to 8.0.1, depending on the version of LibTIFF. This was reported through
5656
`Tidelift`_.
5757

58-
* :cve:`CVE-2020-35655` Fix for SGI Decode buffer overrun
58+
* :cve:`2020-35655` Fix for SGI Decode buffer overrun
5959

6060
4 byte read overflow in ``SgiRleDecode.c``, where the code was not correctly checking the
6161
offsets and length tables. Independently reported through `Tidelift`_ and Google's

0 commit comments

Comments
 (0)