rust/src/libstd/rt
bors d5e9033a0d auto merge of #9108 : blake2-ppc/rust/hazards-on-overflow, r=alexcrichton
Fix uint overflow bugs in std::{at_vec, vec, str}

Closes #8742

Fix issue #8742, which summarized is: unsafe code in vec and str did assume
that a reservation for `X + Y` elements always succeeded, and didn't overflow.

Introduce the method `Vec::reserve_additional(n)` to make it easy to check for
overflow in `Vec::push` and `Vec::push_all`.

In std::str, simplify and remove a lot of the unsafe code and use `push_str`
instead. With improvements to `.push_str` and the new function
`vec::bytes::push_bytes`, it looks like this change has either no or positive
impact on performance.

I believe there are many places still where `v.reserve(A + B)` still can overflow.
This by itself is not an issue unless followed by (unsafe) code that steps aside
boundary checks.
2013-09-16 19:35:50 -07:00
..
io auto merge of #9108 : blake2-ppc/rust/hazards-on-overflow, r=alexcrichton 2013-09-16 19:35:50 -07:00
uv std::rt::uv::file: Enable tests on Win32 2013-09-16 12:01:24 +09:00
args.rs rename std::iterator to std::iter 2013-09-09 03:21:46 -04:00
borrowck.rs librustc: Stop calling each_path in coherence. 2013-08-27 18:47:58 -07:00
comm.rs Remove the iter module. 2013-08-29 01:27:24 -04:00
context.rs Support Win64 context switching 2013-08-26 22:16:54 +09:00
crate_map.rs Convert rust_crate_map.cpp to Rust 2013-09-13 00:47:30 +02:00
env.rs std: Restore dynamic borrow tracking 2013-08-19 20:39:39 -07:00
global_heap.rs Add externfn macro and correctly label fixed_stack_segments 2013-08-19 07:13:15 -04:00
kill.rs auto merge of #8790 : huonw/rust/unsafearc, r=thestinger 2013-08-27 13:20:47 -07:00
local.rs librustc: Fix merge fallout 2013-08-27 19:09:27 -07:00
local_heap.rs librustc: Ensure that type parameters are in the right positions in paths. 2013-08-27 18:47:57 -07:00
local_ptr.rs rt: remove a series of unfortunate casts. 2013-08-29 22:55:59 +10:00
logging.rs Add an SendStr type 2013-09-16 16:57:50 +02:00
message_queue.rs Rename UnsafeAtomicRcBox to UnsafeArc. Fixes #7674. 2013-08-27 20:12:39 +10:00
mod.rs Convert rust_crate_map.cpp to Rust 2013-09-13 00:47:30 +02:00
rc.rs Change finalize -> drop. 2013-06-25 21:14:39 -04:00
rtio.rs std::rt: Add get_host_addresses function 2013-09-05 14:22:16 -07:00
sched.rs rename std::iterator to std::iter 2013-09-09 03:21:46 -04:00
select.rs librustc: Ensure that type parameters are in the right positions in paths. 2013-08-27 18:47:57 -07:00
sleeper_list.rs Rename UnsafeAtomicRcBox to UnsafeArc. Fixes #7674. 2013-08-27 20:12:39 +10:00
stack.rs Remove offset_inbounds for an unsafe offset function 2013-08-27 23:22:52 -07:00
task.rs Consolidate local_data implementations, and cleanup 2013-08-27 21:29:11 -07:00
test.rs Remove {uint,int,u64,i64,...}::from_str,from_str_radix 2013-09-15 14:29:16 +02:00
thread.rs Add externfn macro and correctly label fixed_stack_segments 2013-08-19 07:13:15 -04:00
thread_local_storage.rs std: Add Win64 support 2013-08-26 22:15:45 +09:00
tube.rs librustc: Ensure that type parameters are in the right positions in paths. 2013-08-27 18:47:57 -07:00
util.rs rt: Handle non-integer RUST_THREADS (slightly) more gracefully. 2013-08-29 22:55:59 +10:00
work_queue.rs Change concurrency primitives to standard naming conventions 2013-07-27 22:06:29 -07:00