summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/unx/file_url.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/sal/osl/unx/file_url.cxx b/sal/osl/unx/file_url.cxx
index 839eae27e6e9..cc9907a96060 100644
--- a/sal/osl/unx/file_url.cxx
+++ b/sal/osl/unx/file_url.cxx
@@ -22,6 +22,7 @@
#include "system.hxx"
#include <cassert>
+#include <stdexcept>
#include <limits.h>
#include <errno.h>
#include <strings.h>
@@ -204,8 +205,13 @@ oslFileError getSystemPathFromFileUrl(
oslFileError SAL_CALL osl_getSystemPathFromFileURL( rtl_uString *ustrFileURL, rtl_uString **pustrSystemPath )
{
OUString path;
- auto e = getSystemPathFromFileUrl(
- OUString::unacquired(&ustrFileURL), &path, true);
+ oslFileError e;
+ try {
+ e = getSystemPathFromFileUrl(
+ OUString::unacquired(&ustrFileURL), &path, true);
+ } catch (std::length_error) {
+ e = osl_File_E_RANGE;
+ }
if (e == osl_File_E_None) {
rtl_uString_assign(pustrSystemPath, path.pData);
}