mirror of
https://github.com/RGBCube/serenity
synced 2026-01-15 07:21:00 +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. |
||
|---|---|---|
| .. | ||
| arch | ||
| cdefs.h | ||
| file.cpp | ||
| file.h | ||
| internals.h | ||
| ioctl.h | ||
| ioctl_numbers.h | ||
| kcov.h | ||
| mman.cpp | ||
| mman.h | ||
| param.h | ||
| prctl.cpp | ||
| prctl.h | ||
| prctl_numbers.h | ||
| ptrace.cpp | ||
| ptrace.h | ||
| resource.h | ||
| select.cpp | ||
| select.h | ||
| socket.cpp | ||
| socket.h | ||
| stat.h | ||
| statvfs.cpp | ||
| statvfs.h | ||
| sysmacros.h | ||
| time.h | ||
| times.h | ||
| ttydefaults.h | ||
| types.h | ||
| uio.cpp | ||
| uio.h | ||
| un.h | ||
| utsname.h | ||
| wait.cpp | ||
| wait.h | ||