nixpkgs/pkgs/development/libraries/freetype/cve-2017-8287.patch
Vladimír Čunát b0d2de45cd
freetype: fix CVE-2017-{8105,8287} by upstream patches
I copied the patches, as the changelog changes would certainly conflict.
2017-05-14 15:00:44 +02:00

23 lines
769 B
Diff

http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=3774fc08b
diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c
index d18e821..0baf836 100644
--- a/src/psaux/psobjs.c
+++ b/src/psaux/psobjs.c
@@ -1718,6 +1718,14 @@
first = outline->n_contours <= 1
? 0 : outline->contours[outline->n_contours - 2] + 1;
+ /* in malformed fonts it can happen that a contour was started */
+ /* but no points were added */
+ if ( outline->n_contours && first == outline->n_points )
+ {
+ outline->n_contours--;
+ return;
+ }
+
/* We must not include the last point in the path if it */
/* is located on the first point. */
if ( outline->n_points > 1 )