desktop/unx/source/start.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f16cc7d9a8f987c512d51c62e067c032e619b746
Author:     Buo-ren Lin (OSSII) <buoren....@ossii.com.tw>
AuthorDate: Tue Jul 22 18:34:01 2025 +0800
Commit:     Stephan Bergmann <stephan.bergm...@collabora.com>
CommitDate: Tue Jul 22 17:20:29 2025 +0200

    tdf#167633 desktop: Fix dbg build crash in extend_library_path
    
    The root cause of this problem is that the extend_library_path function
    wrongly assumes that the value of the developer's LD_LIBRARY_PATH
    environment variable only consists of ASCII characters and use the
    rtl_uString_newFromAscii function call which is incapable of handling
    non-ASCII strings.
    
    This patch replaces the aforementioned call with rtl_string2UString,
    which is capable of handling such strings.
    
    Signed-off-by: Buo-ren Lin (OSSII) <buoren....@ossii.com.tw>
    Change-Id: I0b42401c32e091296a389113826cac5a1f41adf4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188155
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <stephan.bergm...@collabora.com>

diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c
index 0b1cdd866337..c80980389181 100644
--- a/desktop/unx/source/start.c
+++ b/desktop/unx/source/start.c
@@ -587,7 +587,7 @@ static void extend_library_path(const char *new_element)
     rtl_uString *pEnvName=NULL, *pOrigEnvVar=NULL, *pNewEnvVar=NULL;
 
     rtl_uString_newFromAscii(&pEnvName, "LD_LIBRARY_PATH");
-    rtl_uString_newFromAscii(&pNewEnvVar, new_element);
+    rtl_string2UString(&pNewEnvVar, new_element, strlen(new_element), 
RTL_TEXTENCODING_UTF8, OSTRING_TO_OUSTRING_CVTFLAGS);
 
     osl_getEnvironment(pEnvName, &pOrigEnvVar);
     if (pOrigEnvVar && pOrigEnvVar->length)

Reply via email to