Explorar el Código

debListParser: Do not validate Description-md5 for correctness twice

The Set() method returns false if the input is no hex number,
so simply use that.
Julian Andres Klode hace 10 años
padre
commit
50b7dbc5a8
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. 4 2
      apt-pkg/deb/deblistparser.cc

+ 4 - 2
apt-pkg/deb/deblistparser.cc

@@ -284,8 +284,10 @@ MD5SumValue debListParser::Description_md5()
    }
    else if (likely(value.size() == 32))
    {
-      if (likely(value.find_first_not_of("0123456789abcdefABCDEF") == string::npos))
-	 return MD5SumValue(value);
+      MD5SumValue sumvalue;
+      if (sumvalue.Set(value))
+	 return sumvalue;
+
       _error->Error("Malformed Description-md5 line; includes invalid character '%s'", value.c_str());
       return MD5SumValue();
    }