tomcat/tomcat6-6.0-rhbz-674601.patch
2011-02-02 16:34:58 -07:00

19 lines
827 B
Diff

--- ./java/org/apache/catalina/connector/Request.java.orig 2011-02-02 15:50:25.623469439 -0700
+++ ./java/org/apache/catalina/connector/Request.java 2011-02-02 15:51:58.832219055 -0700
@@ -2717,8 +2717,14 @@
int semi = entry.indexOf(";q=");
if (semi >= 0) {
try {
- quality = Double.parseDouble(entry.substring(semi + 3));
+ String strQuality = entry.substring(semi + 3);
+ if (strQuality.length() <= 5) {
+ quality = Double.parseDouble(strQuality);
+ } else {
+ quality = 0.0;
+ }
} catch (NumberFormatException e) {
+
quality = 0.0;
}
entry = entry.substring(0, semi);