From 0c0880d83630203e82a44b24e70bd11831465263 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20N=C3=BCcke?= Date: Sat, 26 Mar 2016 13:28:25 +0100 Subject: [PATCH] Properly erroring on ".." as path to FS methods. Closes #1708. --- src/main/scala/li/cil/oc/server/component/FileSystem.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/li/cil/oc/server/component/FileSystem.scala b/src/main/scala/li/cil/oc/server/component/FileSystem.scala index 4c9f87fe4..ec43a01c1 100644 --- a/src/main/scala/li/cil/oc/server/component/FileSystem.scala +++ b/src/main/scala/li/cil/oc/server/component/FileSystem.scala @@ -320,7 +320,7 @@ class FileSystem(val fileSystem: IFileSystem, var label: Label, val host: Option private def clean(path: String) = { val result = com.google.common.io.Files.simplifyPath(path) - if (result.startsWith("../")) throw new FileNotFoundException(path) + if (result.startsWith("../") || result == "..") throw new FileNotFoundException(path) if (result == "/" || result == ".") "" else result }