Skip to content

Commit d1507ca

Browse files
committed
data parser BUGFIX conversion from JSON to XML path format
One of the string pointers not set in one of the cases.
1 parent 56e7175 commit d1507ca

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/common.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,12 @@ _transform_json2xml(const struct lys_module *module, const char *expr, int schem
395395
}
396396
prefix = mod->prefix;
397397
} else {
398-
name_len = end - cur_expr;
398+
if (end) {
399+
name_len = end - cur_expr;
400+
} else {
401+
name_len = strlen(cur_expr);
402+
end = cur_expr;
403+
}
399404
name = strndup(cur_expr, name_len);
400405
prefix = transform_module_name2import_prefix(module, name);
401406
free(name);

0 commit comments

Comments
 (0)