From b489d51b6c97d8211f2c32eddf742fbd12517850 Mon Sep 17 00:00:00 2001 From: Dorian Johnson <2011@dorianj.net> Date: Tue, 27 Mar 2012 14:54:10 -0500 Subject: [PATCH] libfreerdp-utils: make freerdp_append_shared_library_suffix work when file_path is shorter than the suffix, which is true for 'rail' and '.dylib'. --- libfreerdp-utils/file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libfreerdp-utils/file.c b/libfreerdp-utils/file.c index 4f539e348..5a597f14c 100644 --- a/libfreerdp-utils/file.c +++ b/libfreerdp-utils/file.c @@ -156,7 +156,8 @@ char* freerdp_append_shared_library_suffix(char* file_path) } else { - path = xstrdup(file_path); + path = xmalloc(file_path_length + shared_lib_suffix_length + 1); + sprintf(path, "%s%s", file_path, SHARED_LIB_SUFFIX); } return path;