Просмотр исходного кода

pkgTagSection::Scan: Fix read of uninitialized value

We ignored the boundary of the buffer we were reading in
while scanning for spaces.
Julian Andres Klode лет назад: 10
Родитель
Сommit
67c90775b6
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      apt-pkg/tagfile.cc

+ 1 - 1
apt-pkg/tagfile.cc

@@ -382,7 +382,7 @@ bool pkgTagSection::Scan(const char *Start,unsigned long MaxLength, bool const R
 	 lastTagHash = AlphaHash(Stop, EndTag - Stop);
 	 // find the beginning of the value
 	 Stop = Colon + 1;
-	 for (; isspace_ascii(*Stop) != 0; ++Stop)
+	 for (; Stop < End && isspace_ascii(*Stop) != 0; ++Stop)
 	    if (*Stop == '\n' && Stop[1] != ' ')
 	       break;
 	 if (Stop >= End)