Explorar el Código

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 "

David Kalnischkies hace 16 años
padre
commit
99aa69c74f
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      apt-pkg/versionmatch.cc

+ 1 - 1
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;