- Notifications
You must be signed in to change notification settings - Fork 14.1k
Open
Labels
A-ZSTArea: Zero-sized types (ZSTs).Area: Zero-sized types (ZSTs).A-collectionsArea: `std::collections`Area: `std::collections`C-bugCategory: This is a bug.Category: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Description
I found this comment in the standard library, indicating that BinaryHeap can have an integer overflow with a large collection of ZSTs. This should probably be fixed.
rust/library/alloc/src/collections/binary_heap/mod.rs
Lines 788 to 789 in 467250d
| // FIXME: 2 * hole.pos() + 1 or 2 * hole.pos() + 2 could overflow | |
| // if T is a ZST |
Metadata
Metadata
Assignees
Labels
A-ZSTArea: Zero-sized types (ZSTs).Area: Zero-sized types (ZSTs).A-collectionsArea: `std::collections`Area: `std::collections`C-bugCategory: This is a bug.Category: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.