From f61260ddd312efdb2ebd03fc80cc8edb115d2072 Mon Sep 17 00:00:00 2001 From: Caohongtao Date: Sun, 28 Sep 2025 03:07:26 +0000 Subject: [PATCH 1/2] Fix CVE-2025-7462 Signed-off-by: Caohongtao --- backport-CVE-2025-7462.patch | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 backport-CVE-2025-7462.patch diff --git a/backport-CVE-2025-7462.patch b/backport-CVE-2025-7462.patch new file mode 100644 index 0000000..aef411a --- /dev/null +++ b/backport-CVE-2025-7462.patch @@ -0,0 +1,41 @@ + +diff --git a/devices/vector/gdevpdf.c b/devices/vector/gdevpdf.c +index e75f33a6c..d7d5e8c6b 100644 +--- a/devices/vector/gdevpdf.c ++++ b/devices/vector/gdevpdf.c +@@ -946,15 +946,27 @@ + static int + pdf_ferror(gx_device_pdf *pdev) + { +- gp_fflush(pdev->file); ++ int code = 0; ++ ++ if (pdev->file != NULL) { ++ gp_fflush(pdev->file); ++ code = gp_ferror(pdev->file); ++ } + gp_fflush(pdev->xref.file); +- sflush(pdev->strm); +- sflush(pdev->asides.strm); +- sflush(pdev->streams.strm); +- sflush(pdev->pictures.strm); +- return gp_ferror(pdev->file) || gp_ferror(pdev->xref.file) || +- gp_ferror(pdev->asides.file) || gp_ferror(pdev->streams.file) || +- gp_ferror(pdev->pictures.file); ++ if (pdev->strm->file != NULL) ++ sflush(pdev->strm); ++ if (pdev->asides.strm->file != NULL) ++ sflush(pdev->asides.strm); ++ if (pdev->streams.strm->file != NULL) ++ sflush(pdev->streams.strm); ++ if (pdev->ObjStm.strm != NULL && pdev->ObjStm.strm->file != NULL) { ++ int code2; ++ sflush(pdev->ObjStm.strm); ++ code2 = gp_ferror(pdev->ObjStm.file); ++ if (code >= 0) code = code2; ++ } ++ return gp_ferror(pdev->xref.file) || gp_ferror(pdev->asides.file) || ++ gp_ferror(pdev->streams.file) || code; + } + + /* Compute the dominant text orientation of a page. */ -- Gitee From ba6cf2f694959bfcd32d91b5f527887d0408b9df Mon Sep 17 00:00:00 2001 From: Caohongtao Date: Sun, 28 Sep 2025 03:14:58 +0000 Subject: [PATCH 2/2] Fix CVE-2025-7462 Signed-off-by: Caohongtao --- ghostscript.spec | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ghostscript.spec b/ghostscript.spec index bbfe9ad..905ca32 100644 --- a/ghostscript.spec +++ b/ghostscript.spec @@ -56,6 +56,7 @@ Patch29: backport-CVE-2025-27835.patch Patch30: backport-CVE-2025-27836.patch Patch40: Add-CJK-Chinese-font-mappings.patch Patch41: backport-CVE-2025-48708.patch +Patch42: backport-CVE-2025-7462.patch BuildRequires: automake gcc BuildRequires: adobe-mappings-cmap-devel adobe-mappings-pdf-devel @@ -216,6 +217,12 @@ install -m 0755 -d %{buildroot}%{_datadir}/%{name}/conf.d/ %{_bindir}/dvipdf %changelog +* Sun Sep 28 2025 Caohongtao - 9.55.0-22 +- Type:CVE +- ID:NA +- SUG:NA +- DECS: Fix CVE-2025-7462 + * Fri May 23 2025 Funda Wang - 9.55.0-21 - Type:CVE - ID:NA -- Gitee