aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/proxy/tcpproxy.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2026-04-16 19:08:49 +0200
committerStefan Boberg <[email protected]>2026-04-16 19:08:49 +0200
commit7cc09107bfd952862e253c6bcd4d3d1525723aad (patch)
tree44d066dc4a0e8e546b98234c8bbb1bb6d5d7d610 /src/zenserver/proxy/tcpproxy.cpp
parentFix truncation of 64-bit name length to int32_t in ValidateCbString (diff)
downloadarchived-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