summaryrefslogtreecommitdiff
path: root/lib/northbound_cli.c
diff options
context:
space:
mode:
authorEmanuele Di Pascale <emanuele@voltanet.io>2018-12-04 15:34:09 +0100
committerEmanuele Di Pascale <emanuele@voltanet.io>2018-12-18 15:15:26 +0100
commit8427e0e67445d42dbcc4d6ad8ba018865a4532f2 (patch)
tree897c5819bb5700b98c04b498ec25c05fc6af05e5 /lib/northbound_cli.c
parent625b70e3da7b1ec163607cc7354404904eacf36e (diff)
lib: copy xpaths when enqueing changes
Just copying th const char* of the xpath means that if we are enqueing multiple changes from a buffer, the last xpath addedd will overwrite all of the previous references. Copying the xpath to a buffer simplifies the API when retrofitting the commands. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
Diffstat (limited to 'lib/northbound_cli.c')
-rw-r--r--lib/northbound_cli.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/northbound_cli.c b/lib/northbound_cli.c
index d685a4e7c2..acde0ead02 100644
--- a/lib/northbound_cli.c
+++ b/lib/northbound_cli.c
@@ -71,7 +71,7 @@ void nb_cli_enqueue_change(struct vty *vty, const char *xpath,
}
change = &vty->cfg_changes[vty->num_cfg_changes++];
- change->xpath = xpath;
+ strlcpy(change->xpath, xpath, sizeof(change->xpath));
change->operation = operation;
change->value = value;
}