News for hackers. Stuff that matters.
Re:Getting Past C by Manishearth on Wednesday January 04, 2017 @12:13AM (#13315849)
> I wouldn't be surprised if Rust has mechanisms to chop up arrays in the way I describe and enforce the bounds you provide it

[T]::split_at is probably what you're looking for.

Almost all array handling in Rust is done through slice types which are tagged with sizes.

Re:Getting Past C by wildmusings on Wednesday January 04, 2017 @01:30AM (#13316122)
His point is that you're not forced to do that. And anyhow, that doesn't solve the issue since you can bungle the creation of the slice with the wrong offset or length.
Re:Getting Past C by Manishearth on Wednesday January 04, 2017 @01:36AM (#13316147)
I wasn't refuting their point. I was just pointing this out.

However, you can't bungle the creation of a slice in rust without using explicitly marked unsafe code.

Re:Getting Past C by wildmusings on Wednesday January 04, 2017 @01:42AM (#13316171)
Not bungle in the sense of overflowing the underlying buffer, but overflowing the logical buffer that is contained within it, i.e. getting the wrong slice.
Re:Getting Past C by Manishearth on Wednesday January 04, 2017 @02:07AM (#13316263)
Oh, sure. Like I said, I wasn't refuting their point.