diff options
author | Lars Wendler <polynomial-c@gentoo.org> | 2019-11-14 09:14:49 +0100 |
---|---|---|
committer | Lars Wendler <polynomial-c@gentoo.org> | 2019-11-14 09:15:17 +0100 |
commit | e64d6fba8ed13603a8280f7c633211d4542cb5d0 (patch) | |
tree | dc6ba195b147a83ad3e2e7da681a8ceca0a57821 /net-print/cups-filters | |
parent | dev-python/tld: 0.9.7 bump (diff) | |
download | gentoo-e64d6fba8ed13603a8280f7c633211d4542cb5d0.tar.gz gentoo-e64d6fba8ed13603a8280f7c633211d4542cb5d0.tar.bz2 gentoo-e64d6fba8ed13603a8280f7c633211d4542cb5d0.zip |
net-print/cups-filters: Revbump to fix segfault in cups-browsed
Reported-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
Thanks-to: Joakim Tjernlund <joakim.tjernlund@infinera.com>
Closes: https://bugs.gentoo.org/700024
Package-Manager: Portage-2.3.79, Repoman-2.3.18
Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
Diffstat (limited to 'net-print/cups-filters')
-rw-r--r-- | net-print/cups-filters/cups-filters-1.25.12-r1.ebuild (renamed from net-print/cups-filters/cups-filters-1.25.12.ebuild) | 4 | ||||
-rw-r--r-- | net-print/cups-filters/files/cups-filters-1.25.12-browsed_segfault.patch | 69 |
2 files changed, 73 insertions, 0 deletions
diff --git a/net-print/cups-filters/cups-filters-1.25.12.ebuild b/net-print/cups-filters/cups-filters-1.25.12-r1.ebuild index cc938610ec4f..1179f01061e1 100644 --- a/net-print/cups-filters/cups-filters-1.25.12.ebuild +++ b/net-print/cups-filters/cups-filters-1.25.12-r1.ebuild @@ -53,6 +53,10 @@ BDEPEND=" test? ( media-fonts/dejavu ) " +PATCHES=( + "${FILESDIR}/${P}-browsed_segfault.patch" #700024 +) + src_prepare() { default [[ "${PV}" == "9999" ]] && eautoreconf diff --git a/net-print/cups-filters/files/cups-filters-1.25.12-browsed_segfault.patch b/net-print/cups-filters/files/cups-filters-1.25.12-browsed_segfault.patch new file mode 100644 index 000000000000..8ab644155c32 --- /dev/null +++ b/net-print/cups-filters/files/cups-filters-1.25.12-browsed_segfault.patch @@ -0,0 +1,69 @@ +From 9bf6937633b35cc92bbf30e9eec91ef3c4bb6aad Mon Sep 17 00:00:00 2001 +From: Till Kamppeter <till.kamppeter@gmail.com> +Date: Wed, 13 Nov 2019 18:49:01 +0100 +Subject: [PATCH] cups-browsed: Added missing memory allocations leading to a + segfault. + +--- + NEWS | 5 +++++ + utils/cups-browsed.c | 21 ++++++++++++--------- + 2 files changed, 17 insertions(+), 9 deletions(-) + +diff --git a/NEWS b/NEWS +index 67d1c18f..2de5dab4 100644 +--- a/NEWS ++++ b/NEWS +@@ -1,6 +1,11 @@ + NEWS - OpenPrinting CUPS Filters v1.25.12 - 2019-11-12 + ------------------------------------------------------ + ++CHANGES IN V1.25.13 ++ ++ - cups-browsed: Added some missing memory allocations leading ++ to a segfault (Issue #175). ++ + CHANGES IN V1.25.12 + + - libcupsfilters: Use the text names "Draft", "Normal", and +diff --git a/utils/cups-browsed.c b/utils/cups-browsed.c +index adbf5002..f0e05746 100644 +--- a/utils/cups-browsed.c ++++ b/utils/cups-browsed.c +@@ -2837,6 +2837,15 @@ void get_cluster_default_attributes(ipp_t** merged_attributes, + debug_printf("Default MediaType: %s\n", media_type); + } + ++ if (temp->media_type == NULL) { ++ if (cluster_supports_given_attribute(cluster_name, IPP_TAG_KEYWORD, ++ "media-type-supported")) { ++ temp->media_type = (char*)malloc(sizeof(char)*32); ++ strcpy(temp->media_type, AUTO_OPTION); ++ debug_printf("Default MediaType: " AUTO_OPTION "\n"); ++ } ++ } ++ + if ((media_attr = ippFindAttribute(media_col, "media-source", + IPP_TAG_KEYWORD)) != NULL) { + pwg_ppdize_name(ippGetString(media_attr, 0, NULL), media_source, +@@ -2852,18 +2861,12 @@ void get_cluster_default_attributes(ipp_t** merged_attributes, + if (temp->media_source == NULL) { + if (cluster_supports_given_attribute(cluster_name, IPP_TAG_KEYWORD, + "media-source-supported")) { +- strcpy(temp->media_source,AUTO_OPTION); +- debug_printf("Default MediaSource: %s\n", media_source); ++ temp->media_source = (char*)malloc(sizeof(char)*32); ++ strcpy(temp->media_source, AUTO_OPTION); ++ debug_printf("Default MediaSource: " AUTO_OPTION "\n"); + } + } + +- if (temp->media_type == NULL) { +- if (cluster_supports_given_attribute(cluster_name, IPP_TAG_KEYWORD, +- "media-type-supported")) { +- strcpy(temp->media_type, AUTO_OPTION); +- debug_printf("Default MediaType: %s\n", media_type); +- } +- } + media_col_default = ippAddCollection(*merged_attributes, IPP_TAG_PRINTER, + "media-col-default", NULL); + current_media = create_media_col(temp->x, temp->y, temp->left_margin, |