summaryrefslogtreecommitdiff
path: root/lib/northbound_oper.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/northbound_oper.c')
-rw-r--r--lib/northbound_oper.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/northbound_oper.c b/lib/northbound_oper.c
index 5c2d3ed8c8..ad495b6f9c 100644
--- a/lib/northbound_oper.c
+++ b/lib/northbound_oper.c
@@ -1723,8 +1723,9 @@ static enum nb_error __walk(struct nb_op_yield_state *ys, bool is_resume)
*/
len = darr_strlen(ys->xpath);
if (ni->keys.num) {
- yang_get_key_preds(ys->xpath + len, sib,
- &ni->keys,
+ darr_ensure_avail(ys->xpath,
+ yang_get_key_pred_strlen(sib, &ni->keys) + 1);
+ yang_get_key_preds(ys->xpath + len, sib, &ni->keys,
darr_cap(ys->xpath) - len);
} else {
/* add a position predicate (1s based?) */