[Libreoffice-commits] core.git: include/LibreOfficeKit

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Oct 25 12:44:45 UTC 2018


 include/LibreOfficeKit/LibreOfficeKitInit.h |    9 +++++++++
 1 file changed, 9 insertions(+)

New commits:
commit 88014e265a91753b69b70b5f4b246921d16051de
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Thu Oct 25 15:39:50 2018 +0300
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Thu Oct 25 15:43:03 2018 +0300

    Verify that we are actually passed a URL, not a pathname
    
    Sure, the test could be even more strict and actually do a
    case-insensitive check for an initial "file:" or
    "vnd.sun.star.pathname:".
    
    Change-Id: Ic252aeccdec708138530075d1f38fa348d1e469e

diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h b/include/LibreOfficeKit/LibreOfficeKitInit.h
index a4befd405cb1..ae779f468350 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -291,6 +291,15 @@ static LibreOfficeKit *lok_init_2( const char *install_path,  const char *user_p
         return pSym( install_path );
     }
 
+    if (user_profile_url != NULL && user_profile_url[0] == '/')
+    {
+        // It should be either a file: URL or a vnd.sun.star.pathname: URL.
+        fprintf( stderr, "second parameter to lok_init_2 '%s' should be a URL, not a pathname\n", user_profile_url );
+        lok_dlclose( dlhandle );
+        free( imp_lib );
+        return NULL;
+    }
+
     free( imp_lib );
     // dlhandle is "leaked"
     // coverity[leaked_storage] - on purpose


More information about the Libreoffice-commits mailing list