summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-02-16 13:22:17 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-02-16 13:22:17 +0000
commitd2612bbd21703788a5027c8ca89c972258655f09 (patch)
tree22d62141ae7e4cb3b1a974ddbddc2ffc6fa262fc /contrib
parent7482b059314b42e32ebbd6f9431af9951794dfe2 (diff)
downloadrspamd-d2612bbd21703788a5027c8ca89c972258655f09.tar.gz
rspamd-d2612bbd21703788a5027c8ca89c972258655f09.zip
Port fix from libucl
Diffstat (limited to 'contrib')
-rw-r--r--contrib/libucl/ucl_parser.c4
-rw-r--r--contrib/libucl/ucl_util.c14
2 files changed, 12 insertions, 6 deletions
diff --git a/contrib/libucl/ucl_parser.c b/contrib/libucl/ucl_parser.c
index 9ac535cbe..cceb8a857 100644
--- a/contrib/libucl/ucl_parser.c
+++ b/contrib/libucl/ucl_parser.c
@@ -1575,6 +1575,10 @@ ucl_parse_value (struct ucl_parser *parser, struct ucl_chunk *chunk)
}
obj = ucl_parser_get_container (parser);
+ if (!obj) {
+ return false;
+ }
+
str_len = chunk->pos - c - 2;
obj->type = UCL_STRING;
if ((str_len = ucl_copy_or_store_ptr (parser, c + 1,
diff --git a/contrib/libucl/ucl_util.c b/contrib/libucl/ucl_util.c
index fae6cdeb9..f6d83f163 100644
--- a/contrib/libucl/ucl_util.c
+++ b/contrib/libucl/ucl_util.c
@@ -2769,14 +2769,16 @@ ucl_array_merge (ucl_object_t *top, ucl_object_t *elt, bool copy)
UCL_ARRAY_GET (v1, top);
UCL_ARRAY_GET (v2, cp);
- kv_concat (ucl_object_t *, *v1, *v2);
+ if (v1 && v2) {
+ kv_concat (ucl_object_t *, *v1, *v2);
- for (i = v2->n; i < v1->n; i ++) {
- obj = &kv_A (*v1, i);
- if (*obj == NULL) {
- continue;
+ for (i = v2->n; i < v1->n; i ++) {
+ obj = &kv_A (*v1, i);
+ if (*obj == NULL) {
+ continue;
+ }
+ top->len ++;
}
- top->len ++;
}
return true;