]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
libcupsfilters: Added NULL check when removing ".Borderless" suffixes from page size...
authorTill Kamppeter <till.kamppeter@gmail.com>
Wed, 28 Oct 2020 09:44:19 +0000 (10:44 +0100)
committerTill Kamppeter <till.kamppeter@gmail.com>
Mon, 7 Dec 2020 10:53:04 +0000 (11:53 +0100)
(cherry picked from commit 240ffb901d06a117bb8e10b486bfd3de6fe464b2)

NEWS
cupsfilters/ppdgenerator.c

diff --git a/NEWS b/NEWS
index 4439a6d69dd4ac90f62f45dfedfe76380e9d08b2..8f63cc4017e201e971f76757d2a954eeff5ba37b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,9 @@ NEWS - OpenPrinting CUPS Filters v1.28.6 - 2020-12-02
 
 CHANGES IN V1.28.7
 
+       - libcupsfilters: Added NULL check when removing ".Borderless"
+         suffixes from page size names (Issue #314, Pull request
+         #328).
        - libcupsfilters: In the cupsRasterParseIPPOptions() map the
          color spaces the same way as in the PPD generator (Issue
          #326, Pull request #327).     
index 1368ee6d47a395648e48f41366651477ad7f9172..597ab987acce5d0ea40faf829f96337c31e1fe36 100644 (file)
@@ -2226,7 +2226,8 @@ ppdCreateFromIPP2(char         *buffer,          /* I - Filename buffer */
 
     if (all_borderless) {
       suffix = strcasestr(ppdname, ".Borderless");
-      *suffix = '\0';
+      if (suffix)
+       *suffix = '\0';
     }
 
     cupsFilePrintf(fp, "*OpenUI *PageSize/%s: PickOne\n"
@@ -2260,7 +2261,8 @@ ppdCreateFromIPP2(char         *buffer,          /* I - Filename buffer */
 
       if (all_borderless) {
        suffix = strcasestr(ppdsizename, ".Borderless");
-       *suffix = '\0';
+       if (suffix)
+         *suffix = '\0';
       }
 
       cupsFilePrintf(fp, "*PageSize %s%s%s%s: \"<</PageSize[%s %s]>>setpagedevice\"\n",
@@ -2304,7 +2306,8 @@ ppdCreateFromIPP2(char         *buffer,          /* I - Filename buffer */
 
       if (all_borderless) {
        suffix = strcasestr(ppdsizename, ".Borderless");
-       *suffix = '\0';
+       if (suffix)
+         *suffix = '\0';
       }
 
       cupsFilePrintf(fp, "*PageRegion %s%s%s%s: \"<</PageSize[%s %s]>>setpagedevice\"\n",
@@ -2340,7 +2343,8 @@ ppdCreateFromIPP2(char         *buffer,          /* I - Filename buffer */
 
       if (all_borderless) {
        suffix = strcasestr(ppdsizename, ".Borderless");
-       *suffix = '\0';
+       if (suffix)
+         *suffix = '\0';
       }
 
       cupsFilePrintf(fp, "*ImageableArea %s: \"%s %s %s %s\"\n", ppdsizename,