mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-20 00:47:28 +01:00
lib/suitar: reject names ending in "/." or "/.."
This commit is contained in:
1 parent
5049107b90
commit
742e8b78d9
2 files changed
+6
-3
No files matched your search
@@ -113,6 +113,8 @@ func IsValidHeaderName(name string) bool {
|
||||
(name[len(name)-1] != '/') &&
|
||||
!strings.HasPrefix(name, "./") &&
|
||||
!strings.HasPrefix(name, "../") &&
|
||||
!strings.HasSuffix(name, "/.") &&
|
||||
!strings.HasSuffix(name, "/..") &&
|
||||
!strings.Contains(name, "//") &&
|
||||
!strings.Contains(name, "/./") &&
|
||||
!strings.Contains(name, "/../") &&
|
||||
@@ -208,9 +210,9 @@ func (b *block) isValidHeader(which int) bool {
|
||||
}
|
||||
|
||||
// Check the mode bits.
|
||||
if (b[0x0068] == '6') && (b[0x0069] == '4') && (b[0x006A] == '4') {
|
||||
if (b[0x068] == '6') && (b[0x069] == '4') && (b[0x06A] == '4') {
|
||||
// No-op.
|
||||
} else if (b[0x0068] == '7') && (b[0x0069] == '5') && (b[0x006A] == '5') && (which == 1) {
|
||||
} else if (b[0x068] == '7') && (b[0x069] == '5') && (b[0x06A] == '5') && (which == 1) {
|
||||
// No-op.
|
||||
} else {
|
||||
return false
|
||||
|
||||
Reference in new issue
Block a user