diff options
| author | Stefan Boberg <[email protected]> | 2026-04-16 19:08:49 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2026-04-16 19:08:49 +0200 |
| commit | 7cc09107bfd952862e253c6bcd4d3d1525723aad (patch) | |
| tree | 44d066dc4a0e8e546b98234c8bbb1bb6d5d7d610 /src/zenserver/proxy/tcpproxy.cpp | |
| parent | Fix truncation of 64-bit name length to int32_t in ValidateCbString (diff) | |
| download | archived-zen-7cc09107bfd952862e253c6bcd4d3d1525723aad.tar.xz archived-zen-7cc09107bfd952862e253c6bcd4d3d1525723aad.zip | |
Fix use of uninitialized stat result in POSIX RemoveFileNative
When stat() failed with an errno other than ENOENT the code dropped
out of the error check and then read Stat.st_mode from a struct that
was never populated. IsFileModeReadOnly() therefore inspected
uninitialized stack memory, which could randomly classify the target
as read-only and fail the removal with EACCES, or classify a real
read-only file as writable and corrupt the caller's expectation that
ForceRemoveReadOnlyFiles=false guards them.
Restructure the branches so the mode check only runs when stat()
succeeded, ENOENT continues to short-circuit with a cleared error,
and any other stat() failure falls through to std::filesystem::remove
which will surface the actual OS error via Ec.
Diffstat (limited to 'src/zenserver/proxy/tcpproxy.cpp')
0 files changed, 0 insertions, 0 deletions