From: Alberto Leiva Popper Date: Wed, 13 Mar 2019 00:46:03 +0000 (-0600) Subject: Fix URL shortening during the root strategy X-Git-Tag: v0.0.2~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f6ec3c09e05db838e502f4f2f40627f6219aa373;p=thirdparty%2FFORT-validator.git Fix URL shortening during the root strategy Was completely messing up the RSYNCs. --- diff --git a/src/uri.c b/src/uri.c index 55b0bc1d..351103ee 100644 --- 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;