[nginx] svn commit: r4729 - in branches/stable-1.2: . src/core
mdounin at mdounin.ru
mdounin at mdounin.ru
Mon Jul 2 16:59:34 UTC 2012
Author: mdounin
Date: 2012-07-02 16:59:34 +0000 (Mon, 02 Jul 2012)
New Revision: 4729
URL: http://trac.nginx.org/nginx/changeset/4729/nginx
Log:
Merge of r4690: conflicting wildcard server names fix.
With previous code wildcard names were added to hash even if conflict
was detected. This resulted in identical names in hash and segfault
later in ngx_hash_wildcard_init().
Modified:
branches/stable-1.2/
branches/stable-1.2/src/core/ngx_hash.c
Index: branches/stable-1.2
===================================================================
--- branches/stable-1.2 2012-07-02 16:56:53 UTC (rev 4728)
+++ branches/stable-1.2 2012-07-02 16:59:34 UTC (rev 4729)
Property changes on: branches/stable-1.2
___________________________________________________________________
Modified: svn:mergeinfo
## -1 +1 ##
-/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4689,4692,4694-4696,4699,4704-4706
+/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4690,4692,4694-4696,4699,4704-4706
\ No newline at end of property
Modified: branches/stable-1.2/src/core/ngx_hash.c
===================================================================
--- branches/stable-1.2/src/core/ngx_hash.c 2012-07-02 16:56:53 UTC (rev 4728)
+++ branches/stable-1.2/src/core/ngx_hash.c 2012-07-02 16:59:34 UTC (rev 4729)
@@ -924,17 +924,6 @@
}
- hk = ngx_array_push(hwc);
- if (hk == NULL) {
- return NGX_ERROR;
- }
-
- hk->key.len = last - 1;
- hk->key.data = p;
- hk->key_hash = 0;
- hk->value = value;
-
-
/* check conflicts in wildcard hash */
name = keys->elts;
@@ -972,5 +961,18 @@
ngx_memcpy(name->data, key->data + skip, name->len);
+
+ /* add to wildcard hash */
+
+ hk = ngx_array_push(hwc);
+ if (hk == NULL) {
+ return NGX_ERROR;
+ }
+
+ hk->key.len = last - 1;
+ hk->key.data = p;
+ hk->key_hash = 0;
+ hk->value = value;
+
return NGX_OK;
}
More information about the nginx-devel
mailing list