summaryrefslogtreecommitdiffstats
path: root/include/LibreOfficeKit
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2018-10-25 15:39:50 +0300
committerTor Lillqvist <tml@collabora.com>2018-10-25 15:43:03 +0300
commit88014e265a91753b69b70b5f4b246921d16051de (patch)
tree07d0d07a3f9d48412882384657bc4f11f49e7901 /include/LibreOfficeKit
parentThe 2nd parameter to lo_initialize() is a URL so use such naming consistently (diff)
downloadcore-88014e265a91753b69b70b5f4b246921d16051de.tar.gz
core-88014e265a91753b69b70b5f4b246921d16051de.zip
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
Diffstat (limited to 'include/LibreOfficeKit')
-rw-r--r--include/LibreOfficeKit/LibreOfficeKitInit.h9
1 files changed, 9 insertions, 0 deletions
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