Explorar el Código

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 hace 10 años
padre
commit
67c90775b6
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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)