Pārlūkot izejas kodu

Do not try to update network buffer, if there's no network socket

Source commit: c3ab4487d067b0f3dee0fe0b1d2d0664f922e279
Martin Prikryl 3 gadi atpakaļ
vecāks
revīzija
8c0e341973
1 mainītis faili ar 3 papildinājumiem un 1 dzēšanām
  1. 3 1
      source/core/SecureShell.cpp

+ 3 - 1
source/core/SecureShell.cpp

@@ -2056,6 +2056,7 @@ bool __fastcall TSecureShell::EventSelectLoop(unsigned int MSec, bool ReadEventR
           LogEvent(L"Detected network event");
         }
 
+        DebugAssert(FSocket != INVALID_SOCKET);
         if (Events == NULL)
         {
           if (ProcessNetworkEvents(FSocket))
@@ -2123,7 +2124,8 @@ bool __fastcall TSecureShell::EventSelectLoop(unsigned int MSec, bool ReadEventR
       }
     }
 
-    if ((FSendBuf > 0) && (TicksAfter - FLastSendBufferUpdate >= 1000))
+    if ((FSocket != INVALID_SOCKET) &&
+        (FSendBuf > 0) && (TicksAfter - FLastSendBufferUpdate >= 1000))
     {
       DWORD BufferLen = 0;
       DWORD OutLen = 0;