summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2015-12-27 03:33:12 +0100
committerJulian Andres Klode <jak@debian.org>2015-12-27 04:04:50 +0100
commit50b7dbc5a8d7d53b266636c9f1798df264dbe48f (patch)
tree0f78cfdd9aeb553f41343aa121f152970caaa4f5
parentfc8f1c22523ffc54f5440e19663aa1009b4126ca (diff)
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.
-rw-r--r--apt-pkg/deb/deblistparser.cc6
1 files changed, 4 insertions, 2 deletions
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();
}