summaryrefslogtreecommitdiff
path: root/src/http/modules
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2009-09-14 13:07:23 +0000
committerJonathan Kolb <jon@b0g.us>2009-09-14 13:07:23 +0000
commit07651bee2c67cb8fe4a8d5e40880ac05b6db6dc2 (patch)
treec7dee2ce52cf9515e94846843c60822dcdd2de18 /src/http/modules
parent7b3d98fb1cf253877bc0deeafecd1feeb2b8fd22 (diff)
downloadnginx-07651bee2c67cb8fe4a8d5e40880ac05b6db6dc2.tar.gz
Changes with nginx 0.8.15 14 Sep 2009v0.8.15
*) Security: a segmentation fault might occur in worker process while specially crafted request handling. Thanks to Chris Ries. *) Bugfix: if names .domain.tld, .sub.domain.tld, and .domain-some.tld were defined, then the name .sub.domain.tld was matched by .domain.tld. *) Bugfix: in transparency support in the ngx_http_image_filter_module. *) Bugfix: in file AIO. *) Bugfix: in X-Accel-Redirect usage; the bug had appeared in 0.8.11. *) Bugfix: in embedded perl module; the bug had appeared in 0.8.11.
Diffstat (limited to 'src/http/modules')
-rw-r--r--src/http/modules/ngx_http_geo_module.c2
-rw-r--r--src/http/modules/ngx_http_image_filter_module.c16
-rw-r--r--src/http/modules/ngx_http_log_module.c2
-rw-r--r--src/http/modules/ngx_http_map_module.c2
-rw-r--r--src/http/modules/ngx_http_referer_module.c7
-rw-r--r--src/http/modules/ngx_http_xslt_filter_module.c2
-rw-r--r--src/http/modules/perl/nginx.pm2
-rw-r--r--src/http/modules/perl/ngx_http_perl_module.c3
8 files changed, 28 insertions, 8 deletions
diff --git a/src/http/modules/ngx_http_geo_module.c b/src/http/modules/ngx_http_geo_module.c
index 271b686d9..0ec8d093b 100644
--- a/src/http/modules/ngx_http_geo_module.c
+++ b/src/http/modules/ngx_http_geo_module.c
@@ -906,7 +906,7 @@ ngx_http_geo_cidr(ngx_conf_t *cf, ngx_http_geo_conf_ctx_t *ctx,
/* rc == NGX_BUSY */
- old = (ngx_http_variable_value_t *)
+ old = (ngx_http_variable_value_t *)
ngx_radix32tree_find(ctx->tree, cidr.u.in.addr & cidr.u.in.mask);
ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
diff --git a/src/http/modules/ngx_http_image_filter_module.c b/src/http/modules/ngx_http_image_filter_module.c
index 4af2912c7..653cc791b 100644
--- a/src/http/modules/ngx_http_image_filter_module.c
+++ b/src/http/modules/ngx_http_image_filter_module.c
@@ -679,7 +679,7 @@ static ngx_buf_t *
ngx_http_image_resize(ngx_http_request_t *r, ngx_http_image_filter_ctx_t *ctx)
{
int sx, sy, dx, dy, ox, oy,
- colors, transparent, size;
+ colors, transparent, red, green, blue, size;
u_char *out;
ngx_buf_t *b;
ngx_uint_t resize;
@@ -708,6 +708,16 @@ ngx_http_image_resize(ngx_http_request_t *r, ngx_http_image_filter_ctx_t *ctx)
colors = gdImageColorsTotal(src);
transparent = gdImageGetTransparent(src);
+ if (transparent != -1 && colors) {
+ red = gdImageRed(src, transparent);
+ green = gdImageGreen(src, transparent);
+ blue = gdImageBlue(src, transparent);
+ gdImageColorTransparent(src, -1);
+
+ } else {
+ red = 0; green = 0; blue = 0;
+ }
+
dx = sx;
dy = sy;
@@ -806,7 +816,9 @@ ngx_http_image_resize(ngx_http_request_t *r, ngx_http_image_filter_ctx_t *ctx)
}
}
- gdImageColorTransparent(dst, transparent);
+ if (transparent != -1 && colors) {
+ gdImageColorTransparent(dst, gdImageColorExact(dst, red, green, blue));
+ }
out = ngx_http_image_out(r, ctx->type, dst, &size);
diff --git a/src/http/modules/ngx_http_log_module.c b/src/http/modules/ngx_http_log_module.c
index a5ace7d63..e1d99c05a 100644
--- a/src/http/modules/ngx_http_log_module.c
+++ b/src/http/modules/ngx_http_log_module.c
@@ -676,7 +676,7 @@ ngx_http_log_escape(u_char *dst, u_char *src, size_t size)
/* find the number of the characters to be escaped */
- n = 0;
+ n = 0;
for (i = 0; i < size; i++) {
if (escape[*src >> 5] & (1 << (*src & 0x1f))) {
diff --git a/src/http/modules/ngx_http_map_module.c b/src/http/modules/ngx_http_map_module.c
index 1f7786c3c..abdae0d3b 100644
--- a/src/http/modules/ngx_http_map_module.c
+++ b/src/http/modules/ngx_http_map_module.c
@@ -337,7 +337,7 @@ ngx_http_map_cmp_dns_wildcards(const void *one, const void *two)
first = (ngx_hash_key_t *) one;
second = (ngx_hash_key_t *) two;
- return ngx_strcmp(first->key.data, second->key.data);
+ return ngx_dns_strcmp(first->key.data, second->key.data);
}
diff --git a/src/http/modules/ngx_http_referer_module.c b/src/http/modules/ngx_http_referer_module.c
index 658f4a19c..8daa399bd 100644
--- a/src/http/modules/ngx_http_referer_module.c
+++ b/src/http/modules/ngx_http_referer_module.c
@@ -506,6 +506,11 @@ ngx_http_add_regex_referer(ngx_conf_t *cf, ngx_http_referer_conf_t *rlcf,
ngx_regex_elt_t *re;
u_char errstr[NGX_MAX_CONF_ERRSTR];
+ if (name->len == 1) {
+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "empty regex in \"%V\"", name);
+ return NGX_CONF_ERROR;
+ }
+
if (rlcf->regex == NGX_CONF_UNSET_PTR) {
rlcf->regex = ngx_array_create(cf->pool, 2, sizeof(ngx_regex_elt_t));
if (rlcf->regex == NULL) {
@@ -562,5 +567,5 @@ ngx_http_cmp_referer_wildcards(const void *one, const void *two)
first = (ngx_hash_key_t *) one;
second = (ngx_hash_key_t *) two;
- return ngx_strcmp(first->key.data, second->key.data);
+ return ngx_dns_strcmp(first->key.data, second->key.data);
}
diff --git a/src/http/modules/ngx_http_xslt_filter_module.c b/src/http/modules/ngx_http_xslt_filter_module.c
index cfaa8e1b3..c14d1c4a1 100644
--- a/src/http/modules/ngx_http_xslt_filter_module.c
+++ b/src/http/modules/ngx_http_xslt_filter_module.c
@@ -404,7 +404,7 @@ ngx_http_xslt_add_chunk(ngx_http_request_t *r, ngx_http_xslt_filter_ctx_t *ctx,
sax->endElementNs = ngx_http_xslt_sax_end_element;
sax->characters = ngx_http_xslt_sax_characters;
- sax->ignorableWhitespace = ngx_http_xslt_sax_characters;
+ sax->ignorableWhitespace = ngx_http_xslt_sax_characters;
sax->cdataBlock = ngx_http_xslt_sax_cdata_block;
sax->getEntity = ngx_http_xslt_sax_get_entity;
sax->resolveEntity = ngx_http_xslt_sax_resolve_entity;
diff --git a/src/http/modules/perl/nginx.pm b/src/http/modules/perl/nginx.pm
index b6a68d413..f6378445c 100644
--- a/src/http/modules/perl/nginx.pm
+++ b/src/http/modules/perl/nginx.pm
@@ -47,7 +47,7 @@ our @EXPORT = qw(
HTTP_INSUFFICIENT_STORAGE
);
-our $VERSION = '0.8.14';
+our $VERSION = '0.8.15';
require XSLoader;
XSLoader::load('nginx', $VERSION);
diff --git a/src/http/modules/perl/ngx_http_perl_module.c b/src/http/modules/perl/ngx_http_perl_module.c
index 34ecc9a33..634801ece 100644
--- a/src/http/modules/perl/ngx_http_perl_module.c
+++ b/src/http/modules/perl/ngx_http_perl_module.c
@@ -238,6 +238,7 @@ ngx_http_perl_handle_request(ngx_http_request_t *r)
"perl handler done: %i", rc);
if (rc == NGX_DONE) {
+ ngx_http_finalize_request(r, rc);
return;
}
@@ -257,11 +258,13 @@ ngx_http_perl_handle_request(ngx_http_request_t *r)
ctx->redirect_uri.len = 0;
if (ctx->done || ctx->next) {
+ ngx_http_finalize_request(r, NGX_DONE);
return;
}
if (uri.len) {
ngx_http_internal_redirect(r, &uri, &args);
+ ngx_http_finalize_request(r, NGX_DONE);
return;
}