From: David Kalnischkies Date: Thu, 2 Sep 2010 13:19:51 +0000 (+0200) Subject: check for length of Data to avoid the validness of X-Git-Tag: 0.8.2~1^2~7 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/99aa69c74f27a70d585510b817561fbf20ac7fb5 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 " --- 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;