]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
The DBUS notifier could crash (STR #3947)
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Mon, 3 Oct 2011 17:27:45 +0000 (17:27 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Mon, 3 Oct 2011 17:27:45 +0000 (17:27 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@10041 7a7537e8-13f0-0310-91df-b6672ffda945

CHANGES-1.5.txt
notifier/dbus.c

index 195abe3b16e1d7d2ac9ed731222e7c101ce709e4..736f43be451ec363b1b40987d2e48783d4ea719e 100644 (file)
@@ -4,6 +4,7 @@ CHANGES-1.5.txt
 CHANGES IN CUPS V1.5.1
 
        - Documentation updates (STR #3885, STR #3946)
+       - The DBUS notifier could crash (STR #3947)
        - Relaxed some of the page size checks in cupstestppd.
        - The ipptool program now reports attributes that are repeated within
          the same attribute group.
index 542a929da6eb9fdc022ca248033a9e35073f544d..4f5b48c55b81aad9fb684dd40954cf594967d09b 100644 (file)
@@ -4,7 +4,7 @@
  *   D-Bus notifier for CUPS.
  *
  *   Copyright 2008-2010 by Apple Inc.
- *   Copyright (C) 2007 Red Hat, Inc.
+ *   Copyright (C) 2011 Red Hat, Inc.
  *   Copyright (C) 2007 Tim Waugh <twaugh@redhat.com>
  *   Copyright 1997-2005 by Easy Software Products.
  *
@@ -353,7 +353,7 @@ main(int  argc,                             /* I - Number of command-line args */
     /*
      * Create and send the new message...
      */
-    
+
     fprintf(stderr, "DEBUG: %s\n", signame);
     message = dbus_message_new_signal("/org/cups/cupsd/Notifier",
                                      "org.cups.cupsd.Notifier",
@@ -423,10 +423,11 @@ main(int  argc,                           /* I - Number of command-line args */
          p = printer_reasons;
          for (i = 0; i < attr->num_values; i++)
          {
-           strcpy(p, attr->values[i].string.text);
-           p += strlen(p);
            if (i)
              *p++ = ',';
+
+           strcpy(p, attr->values[i].string.text);
+           p += strlen(p);
          }
          dbus_message_iter_append_string(&iter, &printer_reasons);
        }