X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/4cb0cd1648e4a2623cb00a11b2db2649e286706d..bda94cb8432b3905f5757e92573fd16e73cb183f:/apt-pkg/versionmatch.cc

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;