summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_conf.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/nxt_conf.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/nxt_conf.c b/src/nxt_conf.c
index 57870838..ff82e1d2 100644
--- a/src/nxt_conf.c
+++ b/src/nxt_conf.c
@@ -416,10 +416,13 @@ static void nxt_conf_path_next_token(nxt_conf_path_parse_t *parse,
nxt_conf_value_t *
nxt_conf_get_path(nxt_conf_value_t *value, nxt_str_t *path)
{
+ u_char *end;
nxt_str_t token;
nxt_int_t index;
nxt_conf_path_parse_t parse;
+ u_char buf[256];
+
parse.start = path->start;
parse.end = path->start + path->length;
parse.last = 0;
@@ -436,6 +439,18 @@ nxt_conf_get_path(nxt_conf_value_t *value, nxt_str_t *path)
return NULL;
}
+ if (nxt_slow_path(token.length > 256)) {
+ return NULL;
+ }
+
+ end = nxt_decode_uri(buf, token.start, token.length);
+ if (nxt_slow_path(end == NULL)) {
+ return NULL;
+ }
+
+ token.length = end - buf;
+ token.start = buf;
+
switch (value->type) {
case NXT_CONF_VALUE_OBJECT: