Prevent libcups crash in cups-get-classes patch (bug #736698).
In cups_get_sdests(), when checking whether CUPS_GET_CLASSES is required by determining whether any classes were returned by the CUPS_GET_PRINTERS request, only call cups_find_dest() if any queues were returned at all.
This commit is contained in:
parent
f6b6480f24
commit
aefd94790a
@ -1,7 +1,7 @@
|
|||||||
diff -up cups-1.4rc1/cups/dest.c.cups-get-classes cups-1.4rc1/cups/dest.c
|
diff -up cups-1.4.8/cups/dest.c.cups-get-classes cups-1.4.8/cups/dest.c
|
||||||
--- cups-1.4rc1/cups/dest.c.cups-get-classes 2009-05-13 22:39:17.000000000 +0100
|
--- cups-1.4.8/cups/dest.c.cups-get-classes 2010-08-13 02:34:04.000000000 +0100
|
||||||
+++ cups-1.4rc1/cups/dest.c 2009-07-28 22:17:40.285709944 +0100
|
+++ cups-1.4.8/cups/dest.c 2011-09-14 12:00:56.330558590 +0100
|
||||||
@@ -1735,6 +1735,7 @@ cups_get_sdests(http_t *http, /* I
|
@@ -1755,6 +1755,7 @@ cups_get_sdests(http_t *http, /* I
|
||||||
char uri[1024]; /* printer-uri value */
|
char uri[1024]; /* printer-uri value */
|
||||||
int num_options; /* Number of options */
|
int num_options; /* Number of options */
|
||||||
cups_option_t *options; /* Options */
|
cups_option_t *options; /* Options */
|
||||||
@ -9,7 +9,7 @@ diff -up cups-1.4rc1/cups/dest.c.cups-get-classes cups-1.4rc1/cups/dest.c
|
|||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
char media_default[41]; /* Default paper size */
|
char media_default[41]; /* Default paper size */
|
||||||
#endif /* __APPLE__ */
|
#endif /* __APPLE__ */
|
||||||
@@ -1791,6 +1792,8 @@ cups_get_sdests(http_t *http, /* I
|
@@ -1811,6 +1812,8 @@ cups_get_sdests(http_t *http, /* I
|
||||||
* printer-uri [for IPP_GET_PRINTER_ATTRIBUTES]
|
* printer-uri [for IPP_GET_PRINTER_ATTRIBUTES]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ diff -up cups-1.4rc1/cups/dest.c.cups-get-classes cups-1.4rc1/cups/dest.c
|
|||||||
request = ippNewRequest(op);
|
request = ippNewRequest(op);
|
||||||
|
|
||||||
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
|
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
|
||||||
@@ -1848,6 +1851,23 @@ cups_get_sdests(http_t *http, /* I
|
@@ -1868,6 +1871,23 @@ cups_get_sdests(http_t *http, /* I
|
||||||
attr->value_tag != IPP_TAG_URI)
|
attr->value_tag != IPP_TAG_URI)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ diff -up cups-1.4rc1/cups/dest.c.cups-get-classes cups-1.4rc1/cups/dest.c
|
|||||||
if (!strcmp(attr->name, "auth-info-required") ||
|
if (!strcmp(attr->name, "auth-info-required") ||
|
||||||
!strcmp(attr->name, "device-uri") ||
|
!strcmp(attr->name, "device-uri") ||
|
||||||
!strcmp(attr->name, "marker-change-time") ||
|
!strcmp(attr->name, "marker-change-time") ||
|
||||||
@@ -1939,6 +1959,28 @@ cups_get_sdests(http_t *http, /* I
|
@@ -1959,6 +1979,28 @@ cups_get_sdests(http_t *http, /* I
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ diff -up cups-1.4rc1/cups/dest.c.cups-get-classes cups-1.4rc1/cups/dest.c
|
|||||||
+ * early if so.
|
+ * early if so.
|
||||||
+ */
|
+ */
|
||||||
+
|
+
|
||||||
+ if (op == CUPS_GET_CLASSES)
|
+ if (op == CUPS_GET_CLASSES && num_dests > 0)
|
||||||
+ {
|
+ {
|
||||||
+ int diff;
|
+ int diff;
|
||||||
+ cups_find_dest (printer_name, NULL, num_dests, *dests, 0, &diff);
|
+ cups_find_dest (printer_name, NULL, num_dests, *dests, 0, &diff);
|
||||||
@ -71,7 +71,7 @@ diff -up cups-1.4rc1/cups/dest.c.cups-get-classes cups-1.4rc1/cups/dest.c
|
|||||||
if ((dest = cups_add_dest(printer_name, NULL, &num_dests, dests)) != NULL)
|
if ((dest = cups_add_dest(printer_name, NULL, &num_dests, dests)) != NULL)
|
||||||
{
|
{
|
||||||
dest->num_options = num_options;
|
dest->num_options = num_options;
|
||||||
@@ -1955,6 +1997,16 @@ cups_get_sdests(http_t *http, /* I
|
@@ -1975,6 +2017,16 @@ cups_get_sdests(http_t *http, /* I
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
Summary: Common Unix Printing System
|
Summary: Common Unix Printing System
|
||||||
Name: cups
|
Name: cups
|
||||||
Version: 1.4.8
|
Version: 1.4.8
|
||||||
Release: 3%{?dist}
|
Release: 4%{?dist}
|
||||||
License: GPLv2
|
License: GPLv2
|
||||||
Group: System Environment/Daemons
|
Group: System Environment/Daemons
|
||||||
Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2
|
Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2
|
||||||
@ -577,6 +577,9 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%{php_extdir}/phpcups.so
|
%{php_extdir}/phpcups.so
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Sep 14 2011 Tim Waugh <twaugh@redhat.com> 1:1.4.8-4
|
||||||
|
- Prevent libcups crash in cups-get-classes patch (bug #736698).
|
||||||
|
|
||||||
* Fri Aug 19 2011 Tim Waugh <twaugh@redhat.com> 1:1.4.8-3
|
* Fri Aug 19 2011 Tim Waugh <twaugh@redhat.com> 1:1.4.8-3
|
||||||
- Tighten explicit libs sub-package requirement so that it includes
|
- Tighten explicit libs sub-package requirement so that it includes
|
||||||
the correct architecture as well (bug #731421 comment #8).
|
the correct architecture as well (bug #731421 comment #8).
|
||||||
|
Loading…
Reference in New Issue
Block a user