]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix <rdar://problem/15331639> cups.org: Regression in auto-debug logging
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Mon, 28 Oct 2013 15:35:44 +0000 (15:35 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Mon, 28 Oct 2013 15:35:44 +0000 (15:35 +0000)
Need to use memcpy instead of strlcpy or strcpy.

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@11366 a1ca3aef-8c08-0410-bb20-df032aa958be

CHANGES-1.7.txt
scheduler/log.c

index ca4af37f004ce674ceeaafa07f1cc7b117206fb0..a4421d135ec7f0cd06edda8f6dc7c63cc8d31abc 100644 (file)
@@ -1,6 +1,11 @@
 CHANGES-1.7.txt
 ---------------
 
+CHANGES IN CUPS V1.7.1
+
+       - Auto debug logging was broken in 1.7.0 (<rdar://problem/15331639>)
+
+
 CHANGES IN CUPS V1.7.0
 
        - Updated the Japanese localization.
index 3bea18a27a44c0953ff2e14eba1c5d0f8e950cd7..e72e4431b635900692bff8d1b2af0acfda200c68 100644 (file)
@@ -541,12 +541,13 @@ cupsdLogJob(cupsd_job_t *job,             /* I - Job */
       */
 
       cupsd_joblog_t *temp;            /* Copy of log message */
+      size_t         log_len = strlen(log_line);
+                                       /* Length of log message */
 
-
-      if ((temp = malloc(sizeof(cupsd_joblog_t) + strlen(log_line))) != NULL)
+      if ((temp = malloc(sizeof(cupsd_joblog_t) + log_len)) != NULL)
       {
         temp->time = time(NULL);
-       strlcpy(temp->message, log_line, sizeof(temp->message));
+       memcpy(temp->message, log_line, log_len + 1);
       }
 
       if (!job->history)