Polished patches according to results from static analysis of code (bug #690130).

This commit is contained in:
Jiri Popelka 2011-03-25 16:56:11 +01:00
parent d6f50937a8
commit 85d072c20b
4 changed files with 20 additions and 13 deletions

View File

@ -1139,7 +1139,7 @@ diff -up cups-1.4.6/cups/http-support.c.avahi cups-1.4.6/cups/http-support.c
diff -up cups-1.4.6/scheduler/avahi.c.avahi cups-1.4.6/scheduler/avahi.c
--- cups-1.4.6/scheduler/avahi.c.avahi 2011-01-25 13:26:16.640115190 +0000
+++ cups-1.4.6/scheduler/avahi.c 2011-01-25 13:26:16.640115190 +0000
@@ -0,0 +1,443 @@
@@ -0,0 +1,445 @@
+/*
+ * "$Id$"
+ *
@ -1342,8 +1342,10 @@ diff -up cups-1.4.6/scheduler/avahi.c.avahi cups-1.4.6/scheduler/avahi.c
+ watched_fd = cupsArrayFind (cups_poll->watched_fds, &key);
+ if (watched_fd == NULL) {
+ watched_fd = malloc(sizeof(cupsd_watched_fd_t));
+ if (watched_fd == NULL)
+ if (watched_fd == NULL) {
+ free (watch);
+ return (NULL);
+ }
+
+ watched_fd->fd = fd;
+ watched_fd->occurred = 0;
@ -2795,7 +2797,7 @@ diff -up cups-1.4.6/scheduler/dirsvc.c.avahi cups-1.4.6/scheduler/dirsvc.c
+ AvahiStringList *strlst = NULL;
+ char **elements;
+ size_t len;
+ int i;
+ int i = 0;
+
+ elements = malloc ((1 + count) * sizeof (char *));
+ if (!elements)

View File

@ -15,7 +15,7 @@ new file mode 100644
index 0000000..2fdf401
--- /dev/null
+++ b/scheduler/colord.c
@@ -0,0 +1,665 @@
@@ -0,0 +1,663 @@
+/*
+ * "$Id$"
+ *
@ -612,8 +612,6 @@ index 0000000..2fdf401
+ COLORD_SCOPE_TEMP);
+ break;
+ case PPD_CS_GRAY :
+ if (attr)
+ break;
+ case PPD_CS_N :
+ colordCreateProfile(profiles,
+ p->name,

View File

@ -957,7 +957,7 @@ diff -urNp cups-1.4.6.old/filter/common.c cups-1.4.6/filter/common.c
+ {
+ lines = 1 + (int)(label_len / max_width);
+ line_len = (int)(label_len / lines);
+ wrapped_label = malloc(sizeof(wrapped_label) * lines);
+ wrapped_label = malloc(sizeof(*wrapped_label) * lines);
+ label_index = i = n = 0;
+ while (classification[label_index])
+ {
@ -989,7 +989,7 @@ diff -urNp cups-1.4.6.old/filter/common.c cups-1.4.6/filter/common.c
+ else
+ {
+ lines = 1;
+ wrapped_label = malloc(sizeof(wrapped_label));
+ wrapped_label = malloc(sizeof(*wrapped_label));
+ wrapped_label[0] = (char*)classification;
+ }
+
@ -1115,7 +1115,7 @@ diff -urNp cups-1.4.6.old/filter/pstops.c cups-1.4.6/filter/pstops.c
+ {
+ lines = 1 + (int)(label_len / max_width);
+ line_len = (int)(label_len / lines);
+ wrapped_label = malloc(sizeof(wrapped_label) * lines);
+ wrapped_label = malloc(sizeof(*wrapped_label) * lines);
+ label_index = i = n = 0;
+ while (classification[label_index])
+ {
@ -1147,7 +1147,7 @@ diff -urNp cups-1.4.6.old/filter/pstops.c cups-1.4.6/filter/pstops.c
+ else
+ {
+ lines = 1;
+ wrapped_label = malloc(sizeof(wrapped_label));
+ wrapped_label = malloc(sizeof(*wrapped_label));
+ wrapped_label[0] = (char*)classification;
+ }
+
@ -1963,7 +1963,7 @@ diff -urNp cups-1.4.6.old/scheduler/ipp.c cups-1.4.6/scheduler/ipp.c
/*
* See if we need to add the starting sheet...
@@ -4295,6 +4527,107 @@ check_rss_recipient(
@@ -4295,6 +4527,111 @@ check_rss_recipient(
}
@ -2022,7 +2022,11 @@ diff -urNp cups-1.4.6.old/scheduler/ipp.c cups-1.4.6/scheduler/ipp.c
+ cupsdLogMessage(CUPSD_LOG_ERROR, "check_context: unable to convert %s to SELinux sid", con->scon);
+ return -1;
+ }
+ avc_context_to_sid(job->scon, &jobsid);
+ if (avc_context_to_sid(job->scon, &jobsid) != 0)
+ {
+ cupsdLogMessage(CUPSD_LOG_ERROR, "check_context: unable to convert %s to SELinux sid", job->scon);
+ return -1;
+ }
+ avc_entry_ref_init(&avcref);
+ tclass = SECCLASS_FILE;
+ avr = FILE__READ;

View File

@ -13,7 +13,7 @@
Summary: Common Unix Printing System
Name: cups
Version: 1.4.6
Release: 14%{?dist}
Release: 15%{?dist}
License: GPLv2
Group: System Environment/Daemons
Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2
@ -610,6 +610,9 @@ rm -rf $RPM_BUILD_ROOT
%{php_extdir}/phpcups.so
%changelog
* Fri Mar 25 2011 Jiri Popelka <jpopelka@redhat.com> 1:1.4.6-15
- Polished patches according to results from static analysis of code (bug #690130).
* Thu Mar 10 2011 Tim Waugh <twaugh@redhat.com> 1:1.4.6-14
- Fixed some typos in colord patch.
- LSPP: only warn when unable to get printer context.