diff --git a/src/main/kotlin/link/infra/packwiz/installer/target/path/PackwizPath.kt b/src/main/kotlin/link/infra/packwiz/installer/target/path/PackwizPath.kt index f9e7bef..13efb98 100644 --- a/src/main/kotlin/link/infra/packwiz/installer/target/path/PackwizPath.kt +++ b/src/main/kotlin/link/infra/packwiz/installer/target/path/PackwizPath.kt @@ -43,9 +43,11 @@ abstract class PackwizPath>(path: String? = null) { } else { canonicalised += componentNorm // Don't allow volume letters (allows traversal to the root on Windows) - if (componentNorm[0] in 'a'..'z' || componentNorm[0] in 'A'..'Z') { - if (componentNorm[1] == ':') { - throw RequestException.Validation.PathContainsVolumeLetter(path) + if (componentNorm.length == 2) { + if (componentNorm[0] in 'a'..'z' || componentNorm[0] in 'A'..'Z') { + if (componentNorm[1] == ':') { + throw RequestException.Validation.PathContainsVolumeLetter(path) + } } } }