Skip to content

Commit c1a7b71

Browse files
authored
Merge pull request #20762 from apple/sr-9348
[stdlib] _HashTable.copyContents: Fix out of bounds access
2 parents d5f6d7f + 66db9b4 commit c1a7b71

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stdlib/public/core/HashTable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ extension _HashTable {
406406
@_effects(releasenone)
407407
internal func copyContents(of other: _HashTable) {
408408
_internalInvariant(bucketCount == other.bucketCount)
409-
self.words.assign(from: other.words, count: bucketCount)
409+
self.words.assign(from: other.words, count: wordCount)
410410
}
411411

412412
/// Insert a new entry with the specified hash value into the table.

0 commit comments

Comments
 (0)