]> git.ipfire.org Git - thirdparty/FORT-validator.git/commitdiff
Fix URL shortening during the root strategy
authorAlberto Leiva Popper <ydahhrk@gmail.com>
Wed, 13 Mar 2019 00:46:03 +0000 (18:46 -0600)
committerAlberto Leiva Popper <ydahhrk@gmail.com>
Wed, 13 Mar 2019 00:46:03 +0000 (18:46 -0600)
Was completely messing up the RSYNCs.

src/uri.c

index 55b0bc1db36fae7ba4f04653492e63183c0f5b40..351103eec347913127cdae97de09f351528e8cff 100644 (file)
--- a/src/uri.c
+++ b/src/uri.c
@@ -60,9 +60,11 @@ str2global(char const *str, size_t str_len, struct rpki_uri *uri)
                        return error;
        }
 
-       uri->global = strdup(str);
+       uri->global = malloc(str_len + 1);
        if (uri->global == NULL)
                return pr_enomem();
+       strncpy(uri->global, str, str_len);
+       uri->global[str_len] = '\0';
        uri->global_len = str_len;
 
        return 0;