mirror of
https://github.com/packwiz/packwiz-installer.git
synced 2025-04-19 21:16: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 {
|
} else {
|
||||||
canonicalised += componentNorm
|
canonicalised += componentNorm
|
||||||
// Don't allow volume letters (allows traversal to the root on Windows)
|
// 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[0] in 'a'..'z' || componentNorm[0] in 'A'..'Z') {
|
||||||
if (componentNorm[1] == ':') {
|
if (componentNorm[1] == ':') {
|
||||||
throw RequestException.Validation.PathContainsVolumeLetter(path)
|
throw RequestException.Validation.PathContainsVolumeLetter(path)
|
||||||
@ -50,6 +51,7 @@ abstract class PackwizPath<T: PackwizPath<T>>(path: String? = null) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (canonicalised.isEmpty()) {
|
if (canonicalised.isEmpty()) {
|
||||||
this.path = null
|
this.path = null
|
||||||
|
Loading…
x
Reference in New Issue
Block a user