Prechádzať zdrojové kódy

Fix undocumented pre-condition: path_len must be greater or equal to (strlen(path) + 2) of substitute_index_file()

xtne6f 7 rokov pred
rodič
commit
9e66683be3
1 zmenil súbory, kde vykonal 1 pridanie a 1 odobranie
  1. 1 1
      src/civetweb.c

+ 1 - 1
src/civetweb.c

@@ -6726,7 +6726,7 @@ substitute_index_file(struct mg_connection *conn,
 	 * path and see if the file exists. If it exists, break the loop */
 	while ((list = next_option(list, &filename_vec, NULL)) != NULL) {
 		/* Ignore too long entries that may overflow path buffer */
-		if (filename_vec.len > (path_len - (n + 2))) {
+		if ((filename_vec.len + 1) > (path_len - (n + 1))) {
 			continue;
 		}