Bladeren bron

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 10 jaren geleden
bovenliggende
commit
50b7dbc5a8
1 gewijzigde bestanden met toevoegingen van 4 en 2 verwijderingen
  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))
    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());
       _error->Error("Malformed Description-md5 line; includes invalid character '%s'", value.c_str());
       return MD5SumValue();
       return MD5SumValue();
    }
    }