浏览代码

Added some build-time verification.

Patrick Trinkle 8 年之前
父节点
当前提交
911a174f52
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/civetweb.c

+ 3 - 0
src/civetweb.c

@@ -6131,6 +6131,9 @@ mg_fgets(char *buf, size_t size, struct mg_file *filep, char **p)
  * to infinitely recurse and then crash.
  */
 #define INITIAL_DEPTH 9
+#if INITIAL_DEPTH <= 0
+#error Bad INITIAL_DEPTH for recursion, set to at least 1
+#endif
 
 struct read_auth_file_struct {
 	struct mg_connection *conn;