transfig/CVE-2021-32280.patch
starlet-dx 0d03fd98d6 fix CVE-2021-32280
(cherry picked from commit a7d683941c244f6a6f31a926e48e8bfb6b0db00a)
2021-10-12 15:36:09 +08:00

20 lines
733 B
Diff

diff --git a/fig2dev/trans_spline.c b/fig2dev/trans_spline.c
index b6fb413..f9b6c18 100644
--- a/fig2dev/trans_spline.c
+++ b/fig2dev/trans_spline.c
@@ -228,6 +228,11 @@ compute_closed_spline(F_spline *spline, float precision)
if (!init_point_array(300, 200))
return NULL;
+ if (!(spline->points /* p0 */ && spline->controls /* s0 */ &&
+ spline->points->next /* p1 */ && spline->controls->next /* s1 */ &&
+ spline->points->next->next && spline->controls->next->next/* p2, s2 */&&
+ spline->points->next->next->next && spline->controls->next->next->next))
+ return NULL;
INIT_CONTROL_POINTS(spline, p0, s0, p1, s1, p2, s2, p3, s3);
COPY_CONTROL_POINT(first, s_first, p0, s0);
--
2.27.0