Sfoglia il codice sorgente

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 16 anni fa
parent
commit
99aa69c74f
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  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 (Type == Origin)
    {
    {
-      if (Data[0] == '"' && Data.end()[-1] == '"')
+      if (Data[0] == '"' && Data.length() >= 2 && Data.end()[-1] == '"')
 	 OrSite = Data.substr(1, Data.length() - 2);
 	 OrSite = Data.substr(1, Data.length() - 2);
       else
       else
 	 OrSite = Data;
 	 OrSite = Data;