summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2020-11-11 19:05:32 -0500
committerGlenn Strauss <gstrauss@gluelogic.com>2020-11-11 19:06:51 -0500
commitc16c6a8f8ffc3b2bfadca338de5aa3afbe99c0d2 (patch)
tree1b7f1890856fa99be8a1155fc2f611c14cea6566
parent82273a947b8ccbfe97f4ace7468c65be52029271 (diff)
downloadlighttpd-git-c16c6a8f8ffc3b2bfadca338de5aa3afbe99c0d2.tar.gz
[mod_alias] validate given order, not sorted order
(bug on master branch) x-ref: "Debian Bullseye/sid arm64 - lighttp broken after update" https://discussions.flightaware.com/t/debian-bullseye-sid-arm64-lighttp-broken-after-update/70756/20
-rw-r--r--src/mod_alias.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mod_alias.c b/src/mod_alias.c
index fb14af18..a7f516d1 100644
--- a/src/mod_alias.c
+++ b/src/mod_alias.c
@@ -51,10 +51,10 @@ static void mod_alias_patch_config(request_st * const r, plugin_data * const p)
static int mod_alias_check_order(server * const srv, const array * const a) {
for (uint32_t j = 0; j < a->used; ++j) {
- const buffer * const prefix = &a->sorted[j]->key;
+ const buffer * const prefix = &a->data[j]->key;
const size_t plen = buffer_string_length(prefix);
for (uint32_t k = j + 1; k < a->used; ++k) {
- const buffer * const key = &a->sorted[k]->key;
+ const buffer * const key = &a->data[k]->key;
if (buffer_string_length(key) < plen) {
break;
}
@@ -62,8 +62,8 @@ static int mod_alias_check_order(server * const srv, const array * const a) {
break;
}
/* ok, they have same prefix. check position */
- const data_unset *dj = a->sorted[j];
- const data_unset *dk = a->sorted[k];
+ const data_unset *dj = a->data[j];
+ const data_unset *dk = a->data[k];
const data_unset **data = (const data_unset **)a->data;
while (*data != dj && *data != dk) ++data;
if (*data == dj) {