1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 02:07:34 +00:00
serenity/Userland/Libraries
Ben Wiederhake 5dc29065e1 LibC: Avoid silent truncation after overlong realpath
The realpath syscall can attempt to return arbitrarily long paths, in particular
paths that are longer than PATH_MAX. The only way to detect this case is
checking whether 'rc', the true length of the returned path including NUL byte,
exceeds our buffer length. In such a case, the buffer contains invalid data.

All Serenity code calls LibC's realpath() with a nullptr buffer, meaning that
realpath is supposed to allocate memory on its own. All Serenity code can handle
arbitrarily long paths returned by LibC's realpath, so it is safe to "do the
dance" and repeat the syscall with a new buffer.

Ports are likely to be graceful in this regard, too. If a Port calls realpath()
with a pre-allocated buffer, however, there is nothing better we can do than
return a truncated buffer.
2021-01-16 22:40:53 +01:00
..
LibAudio Everywhere: Remove a bunch of <AK/SharedBuffer.h> includes 2021-01-16 11:26:53 +01:00
LibC LibC: Avoid silent truncation after overlong realpath 2021-01-16 22:40:53 +01:00
LibChess Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
LibCompress Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
LibCore LibCore: Fix invalid errno 2021-01-16 22:40:53 +01:00
LibCoreDump LibCoreDump: Expose arguments and environment 2021-01-15 23:26:47 +01:00
LibCpp Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
LibCrypt Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
LibCrypto Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
LibDebug Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
LibDesktop Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
LibDiff Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
LibELF LibELF: validate_program_headers: Validate PT_INTERP header p_filesz > 1 2021-01-16 22:39:26 +01:00
LibGemini Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
LibGfx WindowServer+LibGUI: Pass the system theme using Core::AnonymousBuffer 2021-01-16 17:20:53 +01:00
LibGUI LibGUI: Don't bubble window events up to parent windows 2021-01-16 19:35:02 +01:00
LibHTTP Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
LibImageDecoderClient Everywhere: Replace a bundle of dbg with dbgln. 2021-01-16 11:54:35 +01:00
LibIPC LibCore+LibIPC: Add Core::AnonymousBuffer, an IPC-friendly buffer class 2021-01-16 17:20:24 +01:00
LibJS LibJS: Rename ErrorType::ProxyGetOwnDescriptor{Undef => Undefined}Return 2021-01-14 08:13:32 +01:00
LibKeyboard Everywhere: Replace a bundle of dbg with dbgln. 2021-01-16 11:54:35 +01:00
LibLine Everywhere: Replace a bundle of dbg with dbgln. 2021-01-16 11:54:35 +01:00
LibM Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
LibMarkdown Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
LibPCIDB LibC+Everywhere: Remove open_with_path_length() in favor of open() 2021-01-12 23:34:01 +01:00
LibProtocol Everywhere: Remove a bunch of <AK/SharedBuffer.h> includes 2021-01-16 11:26:53 +01:00
LibPthread LibPthread: Add pthread_equal() 2021-01-12 13:42:45 +01:00
LibRegex Everywhere: Replace a bundle of dbg with dbgln. 2021-01-16 11:54:35 +01:00
LibTar Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
LibTextCodec Everywhere: Replace a bundle of dbg with dbgln. 2021-01-16 11:54:35 +01:00
LibThread Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
LibTLS Everywhere: Replace a bundle of dbg with dbgln. 2021-01-16 11:54:35 +01:00
LibTTF Everywhere: Replace a bundle of dbg with dbgln. 2021-01-16 11:54:35 +01:00
LibVT Everywhere: Replace a bundle of dbg with dbgln. 2021-01-16 11:54:35 +01:00
LibWeb WindowServer+LibGUI: Pass the system theme using Core::AnonymousBuffer 2021-01-16 17:20:53 +01:00
LibX86 Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
CMakeLists.txt Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00