mirror of
https://github.com/packwiz/packwiz-installer.git
synced 2025-04-19 13:06:30 +02:00
Fix OutOfBoundsException when parsing a single letter path component
This commit is contained in:
parent
ca172bdefc
commit
783e35cf73
@ -43,6 +43,7 @@ abstract class PackwizPath<T: PackwizPath<T>>(path: String? = null) {
|
||||
} else {
|
||||
canonicalised += componentNorm
|
||||
// Don't allow volume letters (allows traversal to the root on Windows)
|
||||
if (componentNorm.length == 2) {
|
||||
if (componentNorm[0] in 'a'..'z' || componentNorm[0] in 'A'..'Z') {
|
||||
if (componentNorm[1] == ':') {
|
||||
throw RequestException.Validation.PathContainsVolumeLetter(path)
|
||||
@ -50,6 +51,7 @@ abstract class PackwizPath<T: PackwizPath<T>>(path: String? = null) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (canonicalised.isEmpty()) {
|
||||
this.path = null
|
||||
|
Loading…
x
Reference in New Issue
Block a user