{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/26550","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/26550/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/26550/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/26550/events","html_url":"https://github.com/rust-lang/rust/issues/26550","id":90764594,"number":26550,"title":"Unsafe vector overflow","user":{"login":"Veedrac","id":2867413,"avatar_url":"https://avatars.githubusercontent.com/u/2867413?v=3","gravatar_id":"","url":"https://api.github.com/users/Veedrac","html_url":"https://github.com/Veedrac","followers_url":"https://api.github.com/users/Veedrac/followers","following_url":"https://api.github.com/users/Veedrac/following{/other_user}","gists_url":"https://api.github.com/users/Veedrac/gists{/gist_id}","starred_url":"https://api.github.com/users/Veedrac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Veedrac/subscriptions","organizations_url":"https://api.github.com/users/Veedrac/orgs","repos_url":"https://api.github.com/users/Veedrac/repos","events_url":"https://api.github.com/users/Veedrac/events{/privacy}","received_events_url":"https://api.github.com/users/Veedrac/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-06-24T19:33:36Z","updated_at":"2015-06-25T05:33:12Z","closed_at":null,"body":"This gives undefined behaviour due to overflow:\r\n\r\n    fn main() {\r\n        let one_iter = Some(0).into_iter();\r\n        let big_iter = std::iter::repeat(0).take(usize::max_value());\r\n        \r\n        one_iter.chain(big_iter).collect::<Vec<_>>();\r\n    }\r\n\r\nThe problem is the overflow on the addition here:\r\n\r\nhttps://github.com/rust-lang/rust/blob/a6430925b435d5c27bb7fb4088dee06817c83d87/src/libcollections/vec.rs#L1485-L1489"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/115109797","html_url":"https://github.com/rust-lang/rust/issues/26550#issuecomment-115109797","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/26550","id":115109797,"user":{"login":"sfackler","id":1455697,"avatar_url":"https://avatars.githubusercontent.com/u/1455697?v=3","gravatar_id":"","url":"https://api.github.com/users/sfackler","html_url":"https://github.com/sfackler","followers_url":"https://api.github.com/users/sfackler/followers","following_url":"https://api.github.com/users/sfackler/following{/other_user}","gists_url":"https://api.github.com/users/sfackler/gists{/gist_id}","starred_url":"https://api.github.com/users/sfackler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sfackler/subscriptions","organizations_url":"https://api.github.com/users/sfackler/orgs","repos_url":"https://api.github.com/users/sfackler/repos","events_url":"https://api.github.com/users/sfackler/events{/privacy}","received_events_url":"https://api.github.com/users/sfackler/received_events","type":"User","site_admin":false},"created_at":"2015-06-25T05:33:12Z","updated_at":"2015-06-25T05:33:12Z","body":"cc @Gankro "}}