From 50b7dbc5a8d7d53b266636c9f1798df264dbe48f Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 27 Dec 2015 03:33:12 +0100 Subject: 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. --- apt-pkg/deb/deblistparser.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'apt-pkg/deb/deblistparser.cc') diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 85bddcd10..121e02cd2 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/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(); } -- cgit v1.2.3