News for hackers. Stuff that matters.
Re:Memory Safety in Rust: A Case Study with C by nbsd4lyfe on Saturday February 03, 2018 @02:50PM (#16299215)
asserts are for diagnostic-enabled code, don't use them for security checks.
Re:Memory Safety in Rust: A Case Study with C by steveklabnik on Saturday February 03, 2018 @03:06PM (#16299309)
This is one area where Rust also differs from C; assert!s are left on in release mode; you use debug_assert! if you want something only in development.
Re:Memory Safety in Rust: A Case Study with C by nbsd4lyfe on Sunday February 04, 2018 @04:33AM (#16302059)
I agree, it's a hella questionable language choice, and not limited to C.

I found out about it through https://github.com/rohe/pysaml2/issues/451

Re:Memory Safety in Rust: A Case Study with C by reza_n on Saturday February 03, 2018 @03:43PM (#16299528)
I would argue the opposite, assert() statements are the best way to write defensive and secure C. There might have been a time when people commonly compiled out assert() statements from binaries, but that is only OK if the software was designed for that. Otherwise, that would be like me saying I am going to compile out all strlen() statements from a given binary and then expect it to behave the same.
Re:Memory Safety in Rust: A Case Study with C by irundebian on Sunday February 04, 2018 @08:30AM (#16302659)
Secure code should be correct and robust. To assure correctness assert()'s should be used, to assure robustness you should check return values and buffer sizes.