Skip to content

Commit

Permalink
[UWP] Fix potential crash in SbSocketSetTcpWindowScaling (#2063)
Browse files Browse the repository at this point in the history
b/315772525

Change-Id: I883f34429634caadf66ffa002de2ef60778ec2f1
  • Loading branch information
victorpasoshnikov authored Jan 23, 2024
1 parent 61c20a2 commit 6dd5f99
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions starboard/shared/win32/socket_set_tcp_window_scaling.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ bool SbSocketSetTcpWindowScaling(SbSocket socket, bool enable_window_scaling) {
// later, receive window auto-tuning is enabled and the TCP window scale
// factor is reduced to 2 from the default value of 8."

if (socket == kSbSocketInvalid)
return false;

const ULONG target_os_version =
enable_window_scaling ? NTDDI_VISTA : NTDDI_WS03;
WSA_COMPATIBILITY_MODE compatibility_mode = {WsaBehaviorAutoTuning,
Expand Down

0 comments on commit 6dd5f99

Please sign in to comment.