diff options
author | Christian Grothoff <christian@grothoff.org> | 2024-01-09 19:04:34 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2024-01-09 19:04:34 +0100 |
commit | 09a098cf6d0104e7b7700fe8df0b485a267e0be9 (patch) | |
tree | 6d67b9138df06dbb494b011b03477cd4823e24ed | |
parent | 6dcb20755f17d20c107f87f82f1cb79189d890fe (diff) | |
download | gnunet-09a098cf6d0104e7b7700fe8df0b485a267e0be9.tar.gz gnunet-09a098cf6d0104e7b7700fe8df0b485a267e0be9.zip |
fix #8045
-rw-r--r-- | src/lib/util/strings.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/util/strings.c b/src/lib/util/strings.c index f2b88ef47..4f729771c 100644 --- a/src/lib/util/strings.c +++ b/src/lib/util/strings.c | |||
@@ -945,9 +945,8 @@ GNUNET_STRINGS_parse_uri (const char *path, | |||
945 | return GNUNET_NO; | 945 | return GNUNET_NO; |
946 | if (scheme_part) | 946 | if (scheme_part) |
947 | { | 947 | { |
948 | *scheme_part = GNUNET_malloc (post_scheme_part - path + 1); | 948 | *scheme_part = GNUNET_strndup (path, |
949 | GNUNET_memcpy (*scheme_part, path, post_scheme_part - path); | 949 | post_scheme_part - path); |
950 | (*scheme_part)[post_scheme_part - path] = '\0'; | ||
951 | } | 950 | } |
952 | if (path_part) | 951 | if (path_part) |
953 | *path_part = post_scheme_part; | 952 | *path_part = post_scheme_part; |