mirror of
https://dev.iopsys.eu/bbf/icwmp.git
synced 2026-03-13 12:32:20 +01:00
Ticket #8946 : fix add object seg fault issue
This commit is contained in:
parent
e855c7dfaf
commit
ea33b0966b
1 changed files with 7 additions and 1 deletions
|
|
@ -487,7 +487,11 @@ int update_param_instance_alias(struct dmctx *ctx, char *param, char **new_param
|
|||
char *dup = dmstrdup(param);
|
||||
p = buf;
|
||||
for (pch = strtok_r(dup, ".", &spch); pch != NULL; pch = strtok_r(NULL, ".", &spch)) {
|
||||
if (pch[0]== '[' || isdigit(pch[0])) {
|
||||
if (isdigit(pch[0])) {
|
||||
dmstrappendchr(p, '.');
|
||||
dmstrappendstr(p, pch);
|
||||
i++;
|
||||
} else if (pch[0]== '[') {
|
||||
dmstrappendchr(p, '.');
|
||||
dmstrappendstr(p, ctx->inst_buf[i]);
|
||||
i++;
|
||||
|
|
@ -502,6 +506,8 @@ int update_param_instance_alias(struct dmctx *ctx, char *param, char **new_param
|
|||
}
|
||||
}
|
||||
}
|
||||
if (param[strlen(param)-1] == '.')
|
||||
dmstrappendchr(p, '.');
|
||||
dmstrappendend(p);
|
||||
*new_param = dmstrdup(buf);
|
||||
dmfree(dup);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue