summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2017-06-23 17:35:06 +0300
committerValentin Bartenev <vbart@nginx.com>2017-06-23 17:35:06 +0300
commitfa94dc7782827ab13fcf444eb3949b78d5987d83 (patch)
tree7b3d0248f4f0d153c2b56bf8e161e0bd37a1acc0
parent3fcda23f159ac23cd869cd2a702569d2b35ab9bb (diff)
downloadunit-fa94dc7782827ab13fcf444eb3949b78d5987d83.tar.gz
unit-fa94dc7782827ab13fcf444eb3949b78d5987d83.tar.bz2
Configuration: fixed parsing of JSON literals.
Diffstat (limited to '')
-rw-r--r--src/nxt_conf_json.c6
1 files changed, 3 insertions, 3 deletions
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;
}