Skip to content

Commit 21d1f4d

Browse files
committed
auto merge of #17195 : tbu-/rust/pr_strfindoverflow2, r=alexcrichton
2 parents 13037a3 + 259930e commit 21d1f4d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/libcore/str.rs

+3
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,9 @@ enum Searcher {
574574
impl Searcher {
575575
fn new(haystack: &[u8], needle: &[u8]) -> Searcher {
576576
// FIXME: Tune this.
577+
// FIXME(#16715): This unsigned integer addition will probably not
578+
// overflow because that would mean that the memory almost solely
579+
// consists of the needle. Needs #16715 to be formally fixed.
577580
if needle.len() + 20 > haystack.len() {
578581
Naive(NaiveSearcher::new())
579582
} else {

0 commit comments

Comments
 (0)