summaryrefslogtreecommitdiffstats
path: root/src/rest.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rest.c')
-rw-r--r--src/rest.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rest.c b/src/rest.c
index de2d9ed..ec4ae55 100644
--- a/src/rest.c
+++ b/src/rest.c
@@ -5210,10 +5210,14 @@ static int og_cmd_post_repository_add(json_t *element,
json_object_foreach(element, key, value) {
if (!strcmp(key, "name")) {
- err = og_json_parse_string(value, &repo.name);
+ err = og_json_parse_string_copy(value,
+ repo.name,
+ sizeof(repo.name));
params->flags |= OG_REST_PARAM_NAME;
} else if (!strcmp(key, "ip")) {
- err = og_json_parse_string(value, &repo.ip);
+ err = og_json_parse_string_copy(value,
+ repo.ip,
+ sizeof(repo.ip));
params->flags |= OG_REST_PARAM_ADDR;
}