diff options
| author | bors <bors@rust-lang.org> | 2014-09-14 10:36:08 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-09-14 10:36:08 +0000 |
| commit | 21d1f4d7c0e637d8ae073798e666b880d31781b1 (patch) | |
| tree | 509ebfb0dd65ca048cefbf1c04a69562cb11d6dc /src/libcore | |
| parent | 13037a37271f3b9e490d56ba41e56ca75a1167a3 (diff) | |
| parent | 259930e2a304249d9b06557e6d25cab651e0860b (diff) | |
auto merge of #17195 : tbu-/rust/pr_strfindoverflow2, r=alexcrichton
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/str.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libcore/str.rs b/src/libcore/str.rs index d6f35b0dcc6..6837f3b9af7 100644 --- a/src/libcore/str.rs +++ b/src/libcore/str.rs @@ -574,6 +574,9 @@ enum Searcher { impl Searcher { fn new(haystack: &[u8], needle: &[u8]) -> Searcher { // FIXME: Tune this. + // FIXME(#16715): This unsigned integer addition will probably not + // overflow because that would mean that the memory almost solely + // consists of the needle. Needs #16715 to be formally fixed. if needle.len() + 20 > haystack.len() { Naive(NaiveSearcher::new()) } else { |
