Skip to content

Commit 8e38173

Browse files
authored
Merge pull request swiftlang#21008 from mikeash/keypath-allocation-overflow-fix
[Stdlib] Ensure key paths allocate space for the terminating NUL.
2 parents 3e8b015 + 01b840a commit 8e38173

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stdlib/public/core/KeyPath.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2099,7 +2099,7 @@ internal func _appendingKeyPaths<
20992099
rootKVCLength = Int(_swift_stdlib_strlen(rootPtr))
21002100
leafKVCLength = Int(_swift_stdlib_strlen(leafPtr))
21012101
// root + "." + leaf
2102-
appendedKVCLength = rootKVCLength + 1 + leafKVCLength
2102+
appendedKVCLength = rootKVCLength + 1 + leafKVCLength + 1
21032103
} else {
21042104
rootKVCLength = 0
21052105
leafKVCLength = 0

0 commit comments

Comments
 (0)