From e92951d19dfba559e4893cd4ad27980e4a8166f8 Mon Sep 17 00:00:00 2001 From: Christian Beier Date: Thu, 17 Mar 2011 14:51:34 +0100 Subject: [PATCH] Remove useless comparisons that always evaluate to false. There can not be more than 255 security types and MSLogon is RFB 3.6 only. --- libvncclient/rfbproto.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/libvncclient/rfbproto.c b/libvncclient/rfbproto.c index d10e8a6..d424b04 100644 --- a/libvncclient/rfbproto.c +++ b/libvncclient/rfbproto.c @@ -559,11 +559,6 @@ ReadSupportedSecurityType(rfbClient* client, uint32_t *result, rfbBool subAuth) ReadReason(client); return FALSE; } - if (count>sizeof(tAuth)) - { - rfbClientLog("%d security types are too many; maximum is %d\n", count, sizeof(tAuth)); - return FALSE; - } rfbClientLog("We have %d security types to read\n", count); authScheme=0; @@ -573,7 +568,7 @@ ReadSupportedSecurityType(rfbClient* client, uint32_t *result, rfbBool subAuth) if (!ReadFromRFBServer(client, (char *)&tAuth[loop], 1)) return FALSE; rfbClientLog("%d) Received security type %d\n", loop, tAuth[loop]); if (flag) continue; - if (tAuth[loop]==rfbVncAuth || tAuth[loop]==rfbNoAuth || tAuth[loop]==rfbMSLogon || + if (tAuth[loop]==rfbVncAuth || tAuth[loop]==rfbNoAuth || tAuth[loop]==rfbARD || (!subAuth && (tAuth[loop]==rfbTLS || tAuth[loop]==rfbVeNCrypt))) {