From 0a0f70f4e8f2cce669d2313a34c0edf16085183e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?agentzh=20=28=E7=AB=A0=E4=BA=A6=E6=98=A5=29?= Date: Thu, 17 May 2012 21:48:35 +0800 Subject: [PATCH] applied the add_core_vars_polluting patch to fix a bug in the nginx core: http://mailman.nginx.org/pipermail/nginx-devel/2012-May/002231.html --- ...0.15-add_core_vars_polluting_globals.patch | 26 +++++++++++++++++++ util/mirror-tarballs | 3 +++ util/ver | 2 +- 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 patches/nginx-1.0.15-add_core_vars_polluting_globals.patch diff --git a/patches/nginx-1.0.15-add_core_vars_polluting_globals.patch b/patches/nginx-1.0.15-add_core_vars_polluting_globals.patch new file mode 100644 index 0000000..c0f6b49 --- /dev/null +++ b/patches/nginx-1.0.15-add_core_vars_polluting_globals.patch @@ -0,0 +1,26 @@ +--- nginx-1.0.15/src/http/ngx_http_variables.c 2012-03-05 20:36:51.000000000 +0800 ++++ nginx-1.0.15-patched/src/http/ngx_http_variables.c 2012-05-17 16:21:42.120968722 +0800 +@@ -1898,6 +1898,7 @@ + { + ngx_int_t rc; + ngx_http_variable_t *v; ++ ngx_http_variable_t *value; + ngx_http_core_main_conf_t *cmcf; + + cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module); +@@ -1918,7 +1919,14 @@ + } + + for (v = ngx_http_core_variables; v->name.len; v++) { +- rc = ngx_hash_add_key(cmcf->variables_keys, &v->name, v, ++ value = ngx_palloc(cf->pool, sizeof(ngx_http_variable_t)); ++ if (value == NULL) { ++ return NGX_ERROR; ++ } ++ ++ *value = *v; ++ ++ rc = ngx_hash_add_key(cmcf->variables_keys, &value->name, value, + NGX_HASH_READONLY_KEY); + + if (rc == NGX_OK) { diff --git a/util/mirror-tarballs b/util/mirror-tarballs index de80ef0..4cbd7a9 100755 --- a/util/mirror-tarballs +++ b/util/mirror-tarballs @@ -66,6 +66,9 @@ patch -p1 < $root/patches/nginx-$main_ver-reset_wev_handler_in_named_locations.p echo applying filter_finalize_hang.patch ... patch -p1 < $root/patches/nginx-$main_ver-filter_finalize_hang.patch || exit 1 +echo applying add_core_vars_polluting_globals.patch ... +patch -p1 < $root/patches/nginx-$main_ver-add_core_vars_polluting_globals.patch || exit 1 + #echo "INFO: applying null-character-fixes patch" #patch -p0 < $root/patches/nginx-$main_ver-null_character_fixes.patch || exit 1 diff --git a/util/ver b/util/ver index 266e8a0..31da2a2 100755 --- a/util/ver +++ b/util/ver @@ -1,7 +1,7 @@ #!/bin/bash main_ver=1.0.15 -minor_ver=5 +minor_ver=7rc1 version=$main_ver.$minor_ver echo $version