Skip to content

Commit 62fd88e

Browse files
authored
Fix potential SIGSEGV in SbSocketWaiterPrivate initialization (#8464)
Replace SB_DCHECK with SB_CHECK when validating server_socket in GetSocketPipe(). SB_DCHECK is compiled out in Release builds, leading to undefined behavior (null pointer dereference) when AcceptBySpinning() fails or times out. This UB manifests as SIGSEGV crash at line 146 when accessing server_socket_->socket_fd. SB_CHECK ensures validation in all build configurations and provides clear error message on failure instead of unpredictable crash.
1 parent 4fe751a commit 62fd88e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

starboard/shared/libevent/socket_waiter_internal.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ void GetSocketPipe(SbSocket* client_socket, SbSocket* server_socket) {
113113

114114
// Spin until the accept happens (or we get impatient).
115115
*server_socket = AcceptBySpinning(listen_socket, kTimeoutUsec);
116-
SB_DCHECK(SbSocketIsValid(*server_socket));
116+
SB_CHECK(SbSocketIsValid(*server_socket));
117117

118118
result = SbSocketDestroy(listen_socket);
119119
SB_DCHECK(result);

0 commit comments

Comments
 (0)