Skip to content

Commit 035a47a

Browse files
committed
Fix Windows error
1 parent 607df72 commit 035a47a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libraries/System.Net.Quic/src/System/Net/Quic/QuicListener.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ private unsafe int HandleListenerEvent(ref QUIC_LISTENER_EVENT listenerEvent)
181181
}
182182

183183
QuicConnection connection = new QuicConnection(new MsQuicConnection(data.Connection, data.Info));
184-
SslClientHelloInfo clientHello = new SslClientHelloInfo(Marshal.PtrToStringUTF8((IntPtr)data.Info->ServerName, data.Info->ServerNameLength), SslProtocols.Tls13);
184+
SslClientHelloInfo clientHello = new SslClientHelloInfo(data.Info->ServerNameLength > 0 ? Marshal.PtrToStringUTF8((IntPtr)data.Info->ServerName, data.Info->ServerNameLength) : "", SslProtocols.Tls13);
185185

186186
// Kicks off the rest of the handshake in the background.
187187
pendingConnection.StartHandshake(connection, clientHello, _connectionOptionsCallback);

0 commit comments

Comments
 (0)