--- /dev/null
+--- cups-1.1.14/filter/hpgl-input.c.orig 2002-01-02 18:58:57.000000000 +0100
++++ cups-1.1.14/filter/hpgl-input.c 2004-12-22 15:37:13.000000000 +0100
+@@ -3,7 +3,7 @@
+ *
+ * HP-GL/2 input processing for the Common UNIX Printing System (CUPS).
+ *
+- * Copyright 1993-2002 by Easy Software Products.
++ * Copyright 1993-2004 by Easy Software Products.
+ *
+ * These coded instructions, statements, and computer programs are the
+ * property of Easy Software Products and are protected by Federal
+@@ -15,9 +15,9 @@
+ * Attn: CUPS Licensing Information
+ * Easy Software Products
+ * 44141 Airport View Drive, Suite 204
+- * Hollywood, Maryland 20636-3111 USA
++ * Hollywood, Maryland 20636 USA
+ *
+- * Voice: (301) 373-9603
++ * Voice: (301) 373-9600
+ * EMail: cups-info@cups.org
+ * WWW: http://www.cups.org
+ *
+@@ -52,7 +52,8 @@
+ ch, /* Current char */
+ done, /* Non-zero when the current command is read */
+ i; /* Looping var */
+- char buf[262144]; /* String buffer */
++ char buf[262144], /* String buffer */
++ *bufptr; /* Pointer into buffer */
+ static param_t p[MAX_PARAMS]; /* Parameter buffer */
+
+
+@@ -101,11 +102,24 @@
+ }
+ break;
+
++ case '%' : /* PJL command? */
++ if (getc(fp) == '-')
++ {
++ /*
++ * Yes, dump everything up to the "ENTER LANGUAGE" line...
++ */
++
++ while (fgets(buf, sizeof(buf), fp) != NULL)
++ if (strstr(buf, "ENTER") && strstr(buf, "LANGUAGE"))
++ break;
++ break;
++ }
++
+ default : /* HP RTL/PCL control */
+- while ((i = getc(fp)) != EOF && !isupper(i));
++ while ((i = getc(fp)) != EOF && !isupper(i & 255));
+ break;
+ }
+- } while (ch == 0x1b);
++ } while (ch < ' ');
+
+ name[0] = ch;
+ name[1] = getc(fp);
+@@ -113,9 +127,12 @@
+
+ if (strcasecmp(name, "LB") == 0)
+ {
+- for (i = 0; (ch = getc(fp)) != StringTerminator; i ++)
+- buf[i] = ch;
+- buf[i] = '\0';
++ bufptr = buf;
++ while ((ch = getc(fp)) != StringTerminator)
++ if (bufptr < (buf + sizeof(buf) - 1))
++ *bufptr++ = ch;
++ *bufptr = '\0';
++
+ p[num_params].type = PARAM_STRING;
+ p[num_params].value.string = strdup(buf);
+ num_params ++;
+@@ -140,11 +157,12 @@
+ }
+ else if (strcasecmp(name, "PE") == 0)
+ {
+- for (i = 0; i < (sizeof(buf) - 1); i ++)
+- if ((buf[i] = getc(fp)) == ';')
+- break;
++ bufptr = buf;
++ while ((ch = getc(fp)) != ';')
++ if (bufptr < (buf + sizeof(buf) - 1))
++ *bufptr++ = ch;
++ *bufptr = '\0';
+
+- buf[i] = '\0';
+ p[num_params].type = PARAM_STRING;
+ p[num_params].value.string = strdup(buf);
+ num_params ++;