From 99aa69c74f27a70d585510b817561fbf20ac7fb5 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 2 Sep 2010 15:19:51 +0200 Subject: check for length of Data to avoid the validness of Pin: origin " (no error displayed). We already know in this method that Data is at least one char long, so we avoid the length counting as long as the string doesn't start with " --- apt-pkg/versionmatch.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apt-pkg/versionmatch.cc b/apt-pkg/versionmatch.cc index 17a54bc4c..c40b1fdbc 100644 --- a/apt-pkg/versionmatch.cc +++ b/apt-pkg/versionmatch.cc @@ -118,7 +118,7 @@ pkgVersionMatch::pkgVersionMatch(string Data,MatchType Type) : Type(Type) if (Type == Origin) { - if (Data[0] == '"' && Data.end()[-1] == '"') + if (Data[0] == '"' && Data.length() >= 2 && Data.end()[-1] == '"') OrSite = Data.substr(1, Data.length() - 2); else OrSite = Data; -- cgit v1.2.3