Only try to set nego token if load balance info length is >0
authorArmin Novak <armin.novak@thincast.com>
Tue, 2 Jul 2019 09:53:14 +0000 (11:53 +0200)
committerArmin Novak <armin.novak@thincast.com>
Tue, 2 Jul 2019 09:53:14 +0000 (11:53 +0200)
libfreerdp/core/connection.c

index 2500c4d..d6822f7 100644 (file)
@@ -288,7 +288,7 @@ BOOL rdp_client_connect(rdpRdp* rdp)
 
        nego_set_cookie_max_length(rdp->nego, settings->CookieMaxLength);
 
-       if (settings->LoadBalanceInfo)
+       if (settings->LoadBalanceInfo && (settings->LoadBalanceInfoLength > 0))
        {
                if (!nego_set_routing_token(rdp->nego, settings->LoadBalanceInfo, settings->LoadBalanceInfoLength))
                        return FALSE;
@@ -493,8 +493,11 @@ BOOL rdp_client_redirect(rdpRdp* rdp)
 
        if (settings->RedirectionFlags & LB_LOAD_BALANCE_INFO)
        {
-               if (!nego_set_routing_token(rdp->nego, settings->LoadBalanceInfo, settings->LoadBalanceInfoLength))
-                       return FALSE;
+               if (settings->LoadBalanceInfo && (settings->LoadBalanceInfoLength > 0))
+               {
+                       if (!nego_set_routing_token(rdp->nego, settings->LoadBalanceInfo, settings->LoadBalanceInfoLength))
+                               return FALSE;
+               }
        }
        else
        {