소스 검색

Fixed overflow in substitute_index_file()

Sergey Lyubka 13 년 전
부모
커밋
cda24d94fb
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      mongoose.c

+ 1 - 1
mongoose.c

@@ -2683,7 +2683,7 @@ static int substitute_index_file(struct mg_connection *conn, char *path,
   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)
+    if (filename_vec.len > path_len - (n + 2))
       continue;
 
     // Prepare full path to the index file