summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/android/export/export.cpp4
-rw-r--r--platform/iphone/export/export.cpp4
-rw-r--r--platform/javascript/export/export.cpp4
-rw-r--r--platform/osx/export/export.cpp4
-rw-r--r--platform/uwp/export/export.cpp4
5 files changed, 20 insertions, 0 deletions
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp
index 8ffd355219..0f2455914d 100644
--- a/platform/android/export/export.cpp
+++ b/platform/android/export/export.cpp
@@ -1489,6 +1489,10 @@ public:
}
}
+ if (!FileAccess::exists(p_path.get_base_dir())) {
+ return ERR_FILE_BAD_PATH;
+ }
+
FileAccess *src_f = NULL;
zlib_filefunc_def io = zipio_create_io_from_file(&src_f);
diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp
index 67034388b9..05907be020 100644
--- a/platform/iphone/export/export.cpp
+++ b/platform/iphone/export/export.cpp
@@ -836,6 +836,10 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p
}
}
+ if (!FileAccess::exists(dest_dir)) {
+ return ERR_FILE_BAD_PATH;
+ }
+
DirAccess *da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
if (da) {
String current_dir = da->get_current_dir();
diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp
index ec610a70fd..b7ca1eb1d7 100644
--- a/platform/javascript/export/export.cpp
+++ b/platform/javascript/export/export.cpp
@@ -211,6 +211,10 @@ Error EditorExportPlatformJavaScript::export_project(const Ref<EditorExportPrese
template_path = find_export_template(EXPORT_TEMPLATE_WEBASSEMBLY_RELEASE);
}
+ if (!FileAccess::exists(p_path.get_base_dir())) {
+ return ERR_FILE_BAD_PATH;
+ }
+
if (template_path != String() && !FileAccess::exists(template_path)) {
EditorNode::get_singleton()->show_warning(TTR("Template file not found:") + "\n" + template_path);
return ERR_FILE_NOT_FOUND;
diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp
index b8f6977b39..a0eccceed0 100644
--- a/platform/osx/export/export.cpp
+++ b/platform/osx/export/export.cpp
@@ -425,6 +425,10 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
}
}
+ if (!FileAccess::exists(p_path.get_base_dir())) {
+ return ERR_FILE_BAD_PATH;
+ }
+
FileAccess *src_f = NULL;
zlib_filefunc_def io = zipio_create_io_from_file(&src_f);
diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp
index a4655117a7..8405608dd6 100644
--- a/platform/uwp/export/export.cpp
+++ b/platform/uwp/export/export.cpp
@@ -1265,6 +1265,10 @@ public:
}
}
+ if (!FileAccess::exists(p_path.get_base_dir())) {
+ return ERR_FILE_BAD_PATH;
+ }
+
Error err = OK;
FileAccess *fa_pack = FileAccess::open(p_path, FileAccess::WRITE, &err);