components/cups/patches/str4356.patch
author Mohana Rao Gorai <mohana.gorai@oracle.com>
Mon, 13 Oct 2014 00:04:02 -0700
branchs11-update
changeset 3387 37e41c9fcb4f
permissions -rw-r--r--
19276003 problem in UTILITY/CUPS
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3387
37e41c9fcb4f 19276003 problem in UTILITY/CUPS
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
     1
See : http://www.cups.org/str.php?L4356 for details.
37e41c9fcb4f 19276003 problem in UTILITY/CUPS
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
     2
37e41c9fcb4f 19276003 problem in UTILITY/CUPS
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
     3
Index: scheduler/client.c
37e41c9fcb4f 19276003 problem in UTILITY/CUPS
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
     4
===================================================================
37e41c9fcb4f 19276003 problem in UTILITY/CUPS
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
     5
--- scheduler/client.c
37e41c9fcb4f 19276003 problem in UTILITY/CUPS
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
     6
+++ scheduler/client.c
37e41c9fcb4f 19276003 problem in UTILITY/CUPS
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
     7
@@ -4251,6 +4251,14 @@
37e41c9fcb4f 19276003 problem in UTILITY/CUPS
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
     8
     return (0);
37e41c9fcb4f 19276003 problem in UTILITY/CUPS
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
     9
 
37e41c9fcb4f 19276003 problem in UTILITY/CUPS
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    10
  /*
37e41c9fcb4f 19276003 problem in UTILITY/CUPS
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    11
+  * Check for "<" or quotes in the path and reject since this is probably
37e41c9fcb4f 19276003 problem in UTILITY/CUPS
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    12
+  * someone trying to inject HTML...
37e41c9fcb4f 19276003 problem in UTILITY/CUPS
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    13
+  */
37e41c9fcb4f 19276003 problem in UTILITY/CUPS
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    14
+
37e41c9fcb4f 19276003 problem in UTILITY/CUPS
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    15
+  if (strchr(path, '<') != NULL || strchr(path, '\"') != NULL || strchr(path, '\'') != NULL)
37e41c9fcb4f 19276003 problem in UTILITY/CUPS
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    16
+    return (0);
37e41c9fcb4f 19276003 problem in UTILITY/CUPS
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    17
+
37e41c9fcb4f 19276003 problem in UTILITY/CUPS
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    18
+ /*
37e41c9fcb4f 19276003 problem in UTILITY/CUPS
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    19
   * Check for "/.." in the path...
37e41c9fcb4f 19276003 problem in UTILITY/CUPS
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    20
   */
37e41c9fcb4f 19276003 problem in UTILITY/CUPS
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    21