]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix escaping of spaces in options (Issue #1630)
authorMichael R Sweet <msweet@msweet.org>
Sat, 27 Jun 2026 14:25:05 +0000 (10:25 -0400)
committerMichael R Sweet <msweet@msweet.org>
Sat, 27 Jun 2026 14:25:05 +0000 (10:25 -0400)
scheduler/job.c

index 2e61d146424723cbf435a95ea6511174890e8fad..d8e3c602bae097ea8ac321c1b7f5e2951192a450 100644 (file)
@@ -4171,10 +4171,19 @@ get_options(cupsd_job_t *job,           /* I - Job */
 
                if (isspace(*valptr & 255))
                {
+                /*
+                 * Escape whitespace...
+                 */
+
+                 *optptr++ = '\\';
                  *optptr++ = ' ';
                }
                else if ((*valptr & 255) >= ' ' && *valptr != 0x7f)
                {
+                /*
+                 * Escape other special characters as needed...
+                 */
+
                  if (strchr("\\\'\"", *valptr))
                    *optptr++ = '\\';
                  *optptr++ = *valptr;