summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
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;