From 87f52f3149e10e91c8590f65e1c2924034756102 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Tue, 21 Feb 2017 18:08:29 +0100 Subject: [PATCH] [platform] updater temp. directory sanity check (EA-96629) --- .../intellij/openapi/updateSettings/impl/UpdateInstaller.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateInstaller.kt b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateInstaller.kt index f399b772d692..cc80bcee9311 100644 --- a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateInstaller.kt +++ b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateInstaller.kt @@ -111,6 +111,9 @@ object UpdateInstaller { val jnaUtils = findLib("jna-platform.jar") val tempDir = getTempDir() + if (FileUtil.isAncestor(PathManager.getHomePath(), tempDir.path, true)) { + throw IOException("Temp directory inside installation: $tempDir") + } if (!(tempDir.exists() || tempDir.mkdirs())) { throw IOException("Cannot create temp directory: $tempDir") }