From c6dc4ee90670211863d734fcdfe6722d12f65f23 Mon Sep 17 00:00:00 2001 From: Gleb Popov <6yearold@gmail.com> Date: Wed, 2 Aug 2023 20:33:05 +0300 Subject: [PATCH] Make rz_file_path_join prepared for an empty string in the first arg --- librz/util/file.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/librz/util/file.c b/librz/util/file.c index 69e6c4508aa..17ee1f89904 100644 --- a/librz/util/file.c +++ b/librz/util/file.c @@ -1314,6 +1314,9 @@ RZ_API RzList /**/ *rz_file_globsearch(const char *_globbed_path, int ma RZ_API RZ_OWN char *rz_file_path_join(RZ_NONNULL const char *s1, RZ_NULLABLE const char *s2) { rz_return_val_if_fail(s1, NULL); + if (s1[0] == 0) { + return strdup(s2); + } if (!s2) { return strdup(s1); }