mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-22 01:13:00 +02:00
confd: fix segfault when calling 'no dhcp-client'
Fixes #384 Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -384,9 +384,8 @@ static int cand(sr_session_ctx_t *session, uint32_t sub_id, const char *module,
|
||||
return err;
|
||||
|
||||
while (sr_get_change_next(session, iter, &op, &old, &new) == SR_ERR_OK) {
|
||||
char xpath[strlen(new->xpath) + 42];
|
||||
char *xpath, *ptr;
|
||||
size_t cnt = 0;
|
||||
char *ptr;
|
||||
|
||||
switch (op) {
|
||||
case SR_OP_CREATED:
|
||||
@@ -396,6 +395,12 @@ static int cand(sr_session_ctx_t *session, uint32_t sub_id, const char *module,
|
||||
continue;
|
||||
}
|
||||
|
||||
xpath = strdupa(new->xpath);
|
||||
if (!xpath) {
|
||||
ERRNO("Failed strdupa()");
|
||||
return SR_ERR_SYS;
|
||||
}
|
||||
|
||||
strlcpy(xpath, new->xpath, sizeof(xpath));
|
||||
if ((ptr = strstr(xpath, "]/")) == NULL)
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user