File DBUS-notifications-could-crash-the-scheduler-Issue-5.patch of Package cups.6968

Index: cups-1.7.5/scheduler/ipp.c
===================================================================
--- cups-1.7.5.orig/scheduler/ipp.c
+++ cups-1.7.5/scheduler/ipp.c
@@ -1551,6 +1551,16 @@ add_job(cupsd_client_t  *con,		/* I - Cl
     return (NULL);
   }
 
+  attr = ippFindAttribute(con->request, "requesting-user-name", IPP_TAG_NAME);
+
+  if (attr && !ippValidateAttribute(attr))
+  {
+    send_ipp_status(con, IPP_ATTRIBUTES, _("Bad requesting-user-name value: %s"), cupsLastErrorString());
+    if ((attr = ippCopyAttribute(con->response, attr, 0)) != NULL)
+      attr->group_tag = IPP_TAG_UNSUPPORTED_GROUP;
+    return (NULL);
+  }
+
   if ((job = cupsdAddJob(priority, printer->name)) == NULL)
   {
     send_ipp_status(con, IPP_INTERNAL_ERROR,
@@ -1569,8 +1579,6 @@ add_job(cupsd_client_t  *con,		/* I - Cl
   add_job_uuid(job);
   apply_printer_defaults(printer, job);
 
-  attr = ippFindAttribute(job->attrs, "requesting-user-name", IPP_TAG_NAME);
-
   if (con->username[0])
   {
     cupsdSetString(&job->username, con->username);