diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-05-30 17:23:44 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-05-30 17:23:44 +0100 |
commit | ff83de0104b73b4ac8350ad056c6c853cfd0cff4 (patch) | |
tree | b42f2f159294bed85b5474bd880c3c8b1b6524cc /contrib | |
parent | 0992af3130582c82bd4468dfbca62415a72fe743 (diff) | |
download | rspamd-ff83de0104b73b4ac8350ad056c6c853cfd0cff4.tar.gz rspamd-ff83de0104b73b4ac8350ad056c6c853cfd0cff4.zip |
[Minor] LibUCL: Fix reading at the end of chunk
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/libucl/ucl_parser.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/contrib/libucl/ucl_parser.c b/contrib/libucl/ucl_parser.c index 7313b28a3..b048f426a 100644 --- a/contrib/libucl/ucl_parser.c +++ b/contrib/libucl/ucl_parser.c @@ -2366,20 +2366,22 @@ ucl_state_machine (struct ucl_parser *parser) p = chunk->pos; - if (*p == '[') { - parser->state = UCL_STATE_VALUE; - ucl_chunk_skipc (chunk, p); - seen_obrace = true; - } - else { - - if (*p == '{') { + if (p < chunk->end) { + if (*p == '[') { + parser->state = UCL_STATE_VALUE; ucl_chunk_skipc (chunk, p); - parser->state = UCL_STATE_KEY_OBRACE; seen_obrace = true; } else { - parser->state = UCL_STATE_KEY; + + if (*p == '{') { + ucl_chunk_skipc (chunk, p); + parser->state = UCL_STATE_KEY_OBRACE; + seen_obrace = true; + } + else { + parser->state = UCL_STATE_KEY; + } } } |