]> source.dussan.org Git - tigervnc.git/commitdiff
Fix checkNoWait logic in SSecurityPlain.
authorMichal Srb <michalsrb@gmail.com>
Wed, 29 Mar 2017 14:00:30 +0000 (17:00 +0300)
committerMichal Srb <michalsrb@gmail.com>
Thu, 30 Mar 2017 00:25:02 +0000 (03:25 +0300)
Currently it proceeds only if there aren't enough data in queue and then it blocks waiting.
Also the required amount to receive from network is (ulen + plen), not (ulen + plen + 2).

This allowed not authenticated clients to deny service to everyone.

common/rfb/SSecurityPlain.cxx

index f5a5cc7392a8555bde4c03e1f24bb804fe699165..05315490b9e15c77affbec041d27e43e3b5256df 100644 (file)
@@ -92,7 +92,7 @@ bool SSecurityPlain::processMsg(SConnection* sc)
   }
 
   if (state == 1) {
-    if (is->checkNoWait(ulen + plen + 2))
+    if (!is->checkNoWait(ulen + plen))
       return false;
     state = 2;
     pw = new char[plen + 1];