From fa94dc7782827ab13fcf444eb3949b78d5987d83 Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Fri, 23 Jun 2017 17:35:06 +0300 Subject: Configuration: fixed parsing of JSON literals. --- src/nxt_conf_json.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/nxt_conf_json.c b/src/nxt_conf_json.c index 00000002..cea7d880 100644 --- a/src/nxt_conf_json.c +++ b/src/nxt_conf_json.c @@ -613,7 +613,7 @@ nxt_conf_json_parse_value(u_char *pos, u_char *end, return nxt_conf_json_parse_string(pos, end, value, pool); case 't': - if (nxt_fast_path(end - pos >= 4 || nxt_memcmp(pos, "true", 4) == 0)) { + if (nxt_fast_path(end - pos >= 4 && nxt_memcmp(pos, "true", 4) == 0)) { value->u.boolean = 1; value->type = NXT_CONF_JSON_BOOLEAN; @@ -623,7 +623,7 @@ nxt_conf_json_parse_value(u_char *pos, u_char *end, return NULL; case 'f': - if (nxt_fast_path(end - pos >= 5 || nxt_memcmp(pos, "false", 5) == 0)) { + if (nxt_fast_path(end - pos >= 5 && nxt_memcmp(pos, "false", 5) == 0)) { value->u.boolean = 0; value->type = NXT_CONF_JSON_BOOLEAN; @@ -633,7 +633,7 @@ nxt_conf_json_parse_value(u_char *pos, u_char *end, return NULL; case 'n': - if (nxt_fast_path(end - pos >= 4 || nxt_memcmp(pos, "null", 4) == 0)) { + if (nxt_fast_path(end - pos >= 4 && nxt_memcmp(pos, "null", 4) == 0)) { value->type = NXT_CONF_JSON_NULL; return pos + 4; } -- cgit