util, refactor: Rename local `ERR` in `Sock::Accept`
What changed, and why it matters
This is a simple code cleanup change: a local constant named ERR inside one function was renamed to accept_error because it happened to have the same name as a class-level constant. The rename avoids confusion for programmers but does not change any program behavior or fix a security problem.
No security action needed; treat as a normal refactoring cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit renames a local static constexpr auto ERR to accept_error in Sock::Accept() in src/util/sock.cpp. The old name shadowed the Sock::ERR static data member. The rename is purely cosmetic/refactoring; the values (INVALID_SOCKET on Windows, SOCKET_ERROR elsewhere) and the control flow using them remain identical. No functional or security-relevant change is introduced.
Changed components
src/util/sock.cppInspect captured patch +3 / −3
diff --git a/src/util/sock.cpp b/src/util/sock.cpp
index db3f5fc9..0175d669 100644
--- a/src/util/sock.cpp
+++ b/src/util/sock.cpp
@@ -72,15 +72,15 @@ int Sock::Listen(int backlog) const
std::unique_ptr<Sock> Sock::Accept(sockaddr* addr, socklen_t* addr_len) const
{
#ifdef WIN32
- static constexpr auto ERR = INVALID_SOCKET;
+ static constexpr auto accept_error = INVALID_SOCKET;
#else
- static constexpr auto ERR = SOCKET_ERROR;
+ static constexpr auto accept_error = SOCKET_ERROR;
#endif
std::unique_ptr<Sock> sock;
const auto socket = accept(m_socket, addr, addr_len);
- if (socket != ERR) {
+ if (socket != accept_error) {
try {
sock = std::make_unique<Sock>(socket);
} catch (const std::exception&) {
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.