mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-18 19:31:02 +00:00
Fixed overflow in substitute_index_file()
This commit is contained in:
1 parent
f085e68baf
commit
cda24d94fb
1 file changed
+1
-1
+1
-1
@@ -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
|
||||||
|
|||||||
Reference in new issue
Block a user