Blob Blame History Raw
diff -up cups-2.2.1/CHANGES.txt.iso88591 cups-2.2.1/CHANGES.txt
--- cups-2.2.1/CHANGES.txt.iso88591	2016-11-11 13:59:27.597903504 +0100
+++ cups-2.2.1/CHANGES.txt	2016-11-11 14:08:29.149806797 +0100
@@ -1,6 +1,13 @@
-CHANGES.txt - 2.2.1 - 2016-10-03
+CHANGES.txt - 2.2.2 - 2016-10-13
+
 --------------------------------
 
+CHANGES IN CUPS V2.2.2
+
+	- The cups-lpd program did not catch all legacy usage of ISO-8859-1
+          (Issue #4899)
+
+
 CHANGES IN CUPS V2.2.1
 
 	- Added "CreateSelfSignedCerts" directive for cups-files.conf to
diff -up cups-2.2.1/doc/help/man-backend.html.iso88591 cups-2.2.1/doc/help/man-backend.html
--- cups-2.2.1/doc/help/man-backend.html.iso88591	2016-11-11 14:00:00.589652892 +0100
+++ cups-2.2.1/doc/help/man-backend.html	2016-11-11 14:10:54.663706372 +0100
@@ -61,7 +61,7 @@ function may be used to retrieve the cor
 <p>Backends are responsible for reading side-channel requests using the
 <b>cupsSideChannelRead</b>()
 function and responding with the
-<b>cupsSideChannelWrite()</b>
+<b>cupsSideChannelWrite</b>()
 function. The
 <b>CUPS_SC_FD</b>
 constant defines the file descriptor that should be monitored for incoming requests.
@@ -147,7 +147,7 @@ CUPS backends can expect the following e
 <h2 class="title"><a name="FILES">Files</a></h2>
 <i>/etc/cups/cups-files.conf</i>
 <h2 class="title"><a name="NOTES">Notes</a></h2>
-CUPS backends are not generally design to be run directly by the user. Aside from the device URI issue (
+CUPS backends are not generally designed to be run directly by the user. Aside from the device URI issue (
 <i>argv[0]</i>
 and
 <b>DEVICE_URI</b>
diff -up cups-2.2.1/scheduler/cups-lpd.c.iso88591 cups-2.2.1/scheduler/cups-lpd.c
--- cups-2.2.1/scheduler/cups-lpd.c.iso88591	2016-11-11 14:00:37.140376293 +0100
+++ cups-2.2.1/scheduler/cups-lpd.c	2016-11-11 14:15:09.836776667 +0100
@@ -1650,16 +1650,24 @@ smart_strlcpy(char       *dst,		/* I - O
       *dstptr++ = 0xc0 | (*srcptr >> 6);
       *dstptr++ = 0x80 | (*srcptr++ & 0x3f);
     }
-    else if ((*srcptr & 0xe0) == 0xc0)
+    else if ((*srcptr & 0xe0) == 0xc0 && (srcptr[1] & 0xc0) == 0x80)
     {
+     /*
+      * 2-byte UTF-8 sequence...
+      */
+
       if (dstptr > (dstend - 2))
         break;
 
       *dstptr++ = *srcptr++;
       *dstptr++ = *srcptr++;
     }
-    else if ((*srcptr & 0xf0) == 0xe0)
+    else if ((*srcptr & 0xf0) == 0xe0 && (srcptr[1] & 0xc0) == 0x80 && (srcptr[2] & 0xc0) == 0x80)
     {
+     /*
+      * 3-byte UTF-8 sequence...
+      */
+
       if (dstptr > (dstend - 3))
         break;
 
@@ -1667,8 +1675,12 @@ smart_strlcpy(char       *dst,		/* I - O
       *dstptr++ = *srcptr++;
       *dstptr++ = *srcptr++;
     }
-    else if ((*srcptr & 0xf8) == 0xf0)
+    else if ((*srcptr & 0xf8) == 0xf0 && (srcptr[1] & 0xc0) == 0x80 && (srcptr[2] & 0xc0) == 0x80 && (srcptr[3] & 0xc0) == 0x80)
     {
+     /*
+      * 4-byte UTF-8 sequence...
+      */
+
       if (dstptr > (dstend - 4))
         break;
 
@@ -1680,7 +1692,7 @@ smart_strlcpy(char       *dst,		/* I - O
     else
     {
      /*
-      * Orphan UTF-8 sequence, this must be an ISO-8859-1 string...
+      * Bad UTF-8 sequence, this must be an ISO-8859-1 string...
       */
 
       saw_8859 = 1;