RHEL-19433 Incorrect PS header handling in gstopdf
Resolves: RHEL-19433
This commit is contained in:
parent
0e0d9e7a79
commit
fa797f8664
@ -0,0 +1,46 @@
|
||||
diff --git a/filter/gstoraster.c b/filter/gstoraster.c
|
||||
index 0c9f37d..820acc8 100644
|
||||
--- a/filter/gstoraster.c
|
||||
+++ b/filter/gstoraster.c
|
||||
@@ -73,29 +73,23 @@ static GsDocType
|
||||
parse_doc_type(FILE *fp)
|
||||
{
|
||||
char buf[5];
|
||||
- GsDocType doc_type;
|
||||
- char *rc;
|
||||
+ GsDocType type = GS_DOC_TYPE_UNKNOWN;
|
||||
|
||||
/* get the first few bytes of the file */
|
||||
- doc_type = GS_DOC_TYPE_UNKNOWN;
|
||||
rewind(fp);
|
||||
- rc = fgets(buf,sizeof(buf),fp);
|
||||
- if (rc == NULL)
|
||||
- goto out;
|
||||
-
|
||||
- /* is PDF */
|
||||
- if (strncmp(buf,"%PDF",4) == 0) {
|
||||
- doc_type = GS_DOC_TYPE_PDF;
|
||||
- goto out;
|
||||
+/* skip until PDF/PS start header */
|
||||
+ while (fgets(buf, sizeof(buf), fp) != 0) {
|
||||
+ if (strncmp(buf, "%PDF", 4) == 0)
|
||||
+ type = GS_DOC_TYPE_PDF;
|
||||
+ if (strncmp(buf, "%!", 2) == 0)
|
||||
+ type = GS_DOC_TYPE_PS;
|
||||
+ if (type != GS_DOC_TYPE_UNKNOWN)
|
||||
+ break;
|
||||
}
|
||||
|
||||
- /* is PS */
|
||||
- if (strncmp(buf,"%!",2) == 0) {
|
||||
- doc_type = GS_DOC_TYPE_PS;
|
||||
- goto out;
|
||||
- }
|
||||
-out:
|
||||
- return doc_type;
|
||||
+ rewind(fp);
|
||||
+
|
||||
+ return (type);
|
||||
}
|
||||
|
||||
static void
|
@ -11,7 +11,7 @@
|
||||
Summary: OpenPrinting CUPS filters and backends
|
||||
Name: cups-filters
|
||||
Version: 1.20.0
|
||||
Release: 32%{?dist}
|
||||
Release: 33%{?dist}
|
||||
|
||||
# For a breakdown of the licensing, see COPYING file
|
||||
# GPLv2: filters: commandto*, imagetoraster, pdftops, rasterto*,
|
||||
@ -69,6 +69,9 @@ Patch16: 0001-libcupsfilters-Fix-page-range-like-10-in-pdftopdf-fi.patch
|
||||
Patch17: gstoraster-margins.patch
|
||||
# CVE-2023-24805 cups-filters: remote code execution in cups-filters, beh CUPS backend
|
||||
Patch18: beh-cve2023.patch
|
||||
# RHEL-19433 Incorrect PS header handling in gstopdf
|
||||
Patch19: 0001-gstoraster-Improved-detection-whether-input-is-PostS.patch
|
||||
|
||||
|
||||
%if %{with braille}
|
||||
Recommends: %{name}-braille%{?_isa} = %{version}-%{release}
|
||||
@ -243,6 +246,8 @@ The package provides filters and cups-brf backend needed for braille printing.
|
||||
%patch17 -p1 -b .margins
|
||||
# CVE-2023-24805 cups-filters: remote code execution in cups-filters, beh CUPS backend
|
||||
%patch18 -p1 -b .cve202324805
|
||||
# RHEL-19433 Incorrect PS header handling in gstopdf
|
||||
%patch19 -p1 -b .gstoraster-psdetect
|
||||
|
||||
|
||||
%build
|
||||
@ -453,6 +458,9 @@ make check
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Tue Dec 19 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1.20.0-33
|
||||
- RHEL-19433 Incorrect PS header handling in gstopdf
|
||||
|
||||
* Tue Aug 08 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1.20.0-32
|
||||
- 2118406 - texttotext filter strips ESC causing PCL files to be printed improperly
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user