Earlier quoted context omitted.
Rust does have a fix for this: error: this arithmetic operation will overflow --> src/main.rs:2:18 | 2 | let a: u64 = u64::MAX + 1; | ^^^^^^^^^^^^ attempt to compute `u64::MAX + 1_u64`, which would overflow | = note: `#[deny(arithmetic_overflow)]` on by default Rust also allows for overflowing arithmetic (preserving the default to fail): https://doc.rust-lang.org/std/?search=overflowing It's generally less ergonomic,…
Slightly related, I wonder why the return type for `overflowing_add` isn't `Result ` and instead a tuple containing a boolean?
Git security vulnerabilities announced
21–30 of 139 posts
Re: Git security vulnerabilities announced
#22Earlier quoted context omitted.
Rust does have a fix for this: error: this arithmetic operation will overflow --> src/main.rs:2:18 | 2 | let a: u64 = u64::MAX + 1; | ^^^^^^^^^^^^ attempt to compute `u64::MAX + 1_u64`, which would overflow | = note: `#[deny(arithmetic_overflow)]` on by default Rust also allows for overflowing arithmetic (preserving the default to fail): https://doc.rust-lang.org/std/?search=overflowing It's generally less ergonomic,…
Slightly related, I wonder why the return type for `overflowing_add` isn't `Result ` and instead a tuple containing a boolean?
Re: Git security vulnerabilities announced
#23Both critical bugs are integer overflows. It's unclear to me why our languages still default to modulo arithmetic semantics. I feel Rust had a chance to fix this, but also dropped the ball.
Re: Git security vulnerabilities announced
#24[Edit: According to @rlpb's comment, git 2.39.1 is already available on Ubuntu] To install the latest git on Ubuntu: sudo apt upgrade git [Former post included instructions on how to install git from https://launchpad.net/~git-core/+archive/ubuntu/ppa ]
Ubuntu will update git, without having to add this.
Re: Git security vulnerabilities announced
#25Both critical bugs are integer overflows. It's unclear to me why our languages still default to modulo arithmetic semantics. I feel Rust had a chance to fix this, but also dropped the ball.
> Rust had a chance to fix this, but also dropped the ball. By default , a Rust project will panic on integer overflow in debug builds and will overflow on release builds. Two key points to note, however: 1. You can change the setting so that your project panics in release or overflows in debug mode. 2. We reserved the right to change the default at some point in the future. This will probably be widely communicated…
Re: Git security vulnerabilities announced
#26Both critical bugs are integer overflows. It's unclear to me why our languages still default to modulo arithmetic semantics. I feel Rust had a chance to fix this, but also dropped the ball.
Integer overflow isn't a security issue unless your program's memory safety depends on the correctness of the integer operation. Safe rust doesn't (in any build mode), but C/C++ does.
Re: Git security vulnerabilities announced
#27Earlier quoted context omitted.
Rust does have a fix for this: error: this arithmetic operation will overflow --> src/main.rs:2:18 | 2 | let a: u64 = u64::MAX + 1; | ^^^^^^^^^^^^ attempt to compute `u64::MAX + 1_u64`, which would overflow | = note: `#[deny(arithmetic_overflow)]` on by default Rust also allows for overflowing arithmetic (preserving the default to fail): https://doc.rust-lang.org/std/?search=overflowing It's generally less ergonomic,…
Slightly related, I wonder why the return type for `overflowing_add` isn't `Result ` and instead a tuple containing a boolean?
The `(T, bool)` that gets returned is friendly towards optimization.
If you don't use the bool, the overflowing arithmetic is reduced to efficient arithmetic which is overflowing by default. If you do use the bool, the generated code contains one extra instruction.
Re: Git security vulnerabilities announced
#28[Edit: According to @rlpb's comment, git 2.39.1 is already available on Ubuntu] To install the latest git on Ubuntu: sudo apt upgrade git [Former post included instructions on how to install git from https://launchpad.net/~git-core/+archive/ubuntu/ppa ]
Ubuntu will update git, without having to add this.
Re: Git security vulnerabilities announced
#29Both critical bugs are integer overflows. It's unclear to me why our languages still default to modulo arithmetic semantics. I feel Rust had a chance to fix this, but also dropped the ball.
>It's unclear to me why our languages still default to modulo arithmetic semantics. Because that's what processors do? (leaving aside backwards compatibility issues)
The whole point of higher level programming languages is to abstract away the fiddly bits of dealing with processors that we don't want to have to deal with.
This is one of those cases.
Re: Git security vulnerabilities announced
#30Both critical bugs are integer overflows. It's unclear to me why our languages still default to modulo arithmetic semantics. I feel Rust had a chance to fix this, but also dropped the ball.
Integer overflow isn't a security issue unless your program's memory safety depends on the correctness of the integer operation. Safe rust doesn't (in any build mode), but C/C++ does.
`UserAccessLevel > Threshold`
Like there could be a million ways an integer becoming small could mess up something.
Also there are business logic issues as well