Re:Vulnerabilities Induced by Migrating to 64-Bit Platforms ...
by winter_blue on Friday September 23, 2016 @01:18PM
(#12566269)
> For example (short) -1 (0xffff) becomes 2^32-1 (0xffffffff) when casted to uint32_t.
Ideally the compiler would do a check during a conversion from a negative signed integer to unsigned integer, and set a flag or throw some sort of exception. Hopefully future languages (e.g. Rust) learn from this.
Ideally the compiler would do a check during a conversion from a negative signed integer to unsigned integer, and set a flag or throw some sort of exception. Hopefully future languages (e.g. Rust) learn from this.