From: Michael R Sweet Date: Tue, 5 Jun 2018 15:36:07 +0000 (-0400) Subject: Fix a parsing bug in the pstops filter (Issue #5321) X-Git-Tag: v2.3b5~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0541a2c9f4c9bbd69071d63c5a2e98d2f72926c5;p=thirdparty%2Fcups.git Fix a parsing bug in the pstops filter (Issue #5321) --- diff --git a/CHANGES.md b/CHANGES.md index e0b5e9831b..9110251700 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -16,6 +16,7 @@ Changes in CUPS v2.3b5 - The scheduler was always restarted after idle-exit with systemd (Issue #5297) - Added a USB quirks rule for the HP LaserJet P1102 (Issue #5310) - The mailto notifier did not wait for the welcome message (Issue #5312) +- Fixed a parsing bug in the pstops filter (Issue #5321) - Documentation updates (Issue #5299, Issue #5301, Issue #5306) - The scheduler allowed environment variables to be specified in the `cupsd.conf` file (rdar://37836779, rdar://37836995, rdar://37837252, diff --git a/filter/pstops.c b/filter/pstops.c index 5bdac5257d..906a6e78c2 100644 --- a/filter/pstops.c +++ b/filter/pstops.c @@ -1,10 +1,11 @@ /* * PostScript filter for CUPS. * - * Copyright 2007-2015 by Apple Inc. - * Copyright 1993-2007 by Easy Software Products. + * Copyright © 2007-2018 by Apple Inc. + * Copyright © 1993-2007 by Easy Software Products. * - * Licensed under Apache License v2.0. See the file "LICENSE" for more information. + * Licensed under Apache License v2.0. See the file "LICENSE" for more + * information. */ /* @@ -2229,7 +2230,7 @@ parse_text(const char *start, /* I - Start of text value */ bufptr = buffer; bufend = buffer + bufsize - 1; - while (bufptr < bufend) + while (*start && bufptr < bufend) { if (isspace(*start & 255) && !level) break;