mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 19:04:58 +00:00
When the system calls return `NumericLimits<ptrdiff_t>::min()`, negating the return code would produce `NumericLimits<ptrdiff_t>::max() + 1` since we are on a two's complement architecture. Because this value cannot be stored, signed overflow occurs which is UB. This can be fixed by applying the negation to `EMAXERRNO` since that's known to contain a relatively small value. Found when running tests with Clang.
2.4 KiB
2.4 KiB