1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 02:17:35 +00:00
serenity/Userland
Daniel Bertalan 78e7ff008b LibC: Fix negation overflow UB in sys/mman.cpp
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.
2021-08-08 10:55:36 +02:00
..
Applets Everywhere: Replace Model::update() with Model::invalidate() 2021-08-06 19:14:31 +02:00
Applications SystemMonitor: Remove unused this lambda captures 2021-08-08 10:55:36 +02:00
Demos Everywhere: Replace Model::update() with Model::invalidate() 2021-08-06 19:14:31 +02:00
DevTools UserspaceEmulator: Use for_each_region_of_type in find_text_region 2021-08-08 10:55:36 +02:00
DynamicLoader Meta: Add Clang support to the CMake build scripts 2021-08-08 10:55:36 +02:00
Games Solitaire: Don't allow the player to draw cards while mouse is down 2021-08-07 16:59:46 +02:00
Libraries LibC: Fix negation overflow UB in sys/mman.cpp 2021-08-08 10:55:36 +02:00
Services WindowServer: Fix Clang crash when compiling Compositor.cpp 2021-08-08 10:55:36 +02:00
Shell Shell: Make sure TTY echo is enabled when running external commands 2021-08-04 03:14:59 +04:30
Utilities LibCpp: Do lexing in the Preprocessor 2021-08-07 21:24:11 +02:00
CMakeLists.txt Tests: Establish root Tests directory, move Userland/Tests there 2021-05-06 17:54:28 +02:00