Commit cda24d94 authored by Sergey Lyubka's avatar Sergey Lyubka

Fixed overflow in substitute_index_file()

parent f085e68b
...@@ -2683,7 +2683,7 @@ static int substitute_index_file(struct mg_connection *conn, char *path, ...@@ -2683,7 +2683,7 @@ static int substitute_index_file(struct mg_connection *conn, char *path,
while ((list = next_option(list, &filename_vec, NULL)) != NULL) { while ((list = next_option(list, &filename_vec, NULL)) != NULL) {
// Ignore too long entries that may overflow path buffer // Ignore too long entries that may overflow path buffer
if (filename_vec.len > path_len - n) if (filename_vec.len > path_len - (n + 2))
continue; continue;
// Prepare full path to the index file // Prepare full path to the index file
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment