From: Tim Waugh <twaugh@redhat.com>
To: "printing-architecture@lists.linux-foundation.org"
<printing-architecture@lists.linux-foundation.org>
Subject: [Printing-architecture] [patch] cups-1.7.0: job history fix
Date: Fri, 25 Oct 2013 16:36:22 +0100 [thread overview]
Message-ID: <1382715382.32506.5.camel@rubik> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 660 bytes --]
Hi,
While playing around with a logging enhancement¹ I discovered a bug in
the job history code. It was introduced some time after the public
source repository was taken off-line, so I don't know what the
motivation for the change was.
A cups_joblog_t declares 'char message[1]' for the message, and is
allocated with enough storage for the intended message. However, the
message is copied in with strlcpy, with a limit of
sizeof(cups_joblog_t->message). As a result, the message is severely(!)
truncated.
The fix is to undo the change as attached.
Tim.
*/
¹ http://cyberelk.net/tim/2013/10/25/cups-adding-support-for-system-journal/
[-- Attachment #1.2: cups-jobhistory.patch --]
[-- Type: text/x-patch, Size: 537 bytes --]
diff -up cups-1.7rc1/scheduler/log.c.orig cups-1.7rc1/scheduler/log.c
--- cups-1.7rc1/scheduler/log.c.orig 2013-10-24 15:40:42.412062412 +0100
+++ cups-1.7rc1/scheduler/log.c 2013-10-24 15:40:43.329066617 +0100
@@ -534,7 +534,7 @@ cupsdLogJob(cupsd_job_t *job, /* I - Jo
if ((temp = malloc(sizeof(cupsd_joblog_t) + strlen(log_line))) != NULL)
{
temp->time = time(NULL);
- strlcpy(temp->message, log_line, sizeof(temp->message));
+ strcpy(temp->message, log_line);
}
if (!job->history)
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 482 bytes --]
next reply other threads:[~2013-10-25 15:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-25 15:36 Tim Waugh [this message]
2013-10-28 15:30 ` [Printing-architecture] [patch] cups-1.7.0: job history fix Michael Sweet
2013-10-28 15:35 ` Michael Sweet
2013-10-28 16:33 ` Tim Waugh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1382715382.32506.5.camel@rubik \
--to=twaugh@redhat.com \
--cc=printing-architecture@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.