diff options
author | Tor Lillqvist <tml@collabora.com> | 2018-10-25 15:39:50 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2018-10-25 15:43:03 +0300 |
commit | 88014e265a91753b69b70b5f4b246921d16051de (patch) | |
tree | 07d0d07a3f9d48412882384657bc4f11f49e7901 | |
parent | 616554c36eec41f80424dd2a3c1e99d227b9eee6 (diff) |
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
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKitInit.h | 9 |
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 |