SOCKSv5: fix inverted logic (fixes #10247)
authorRémi Denis-Courmont <remi@remlab.net>
Sat, 28 Dec 2013 11:03:53 +0000 (13:03 +0200)
committerFelix Paul Kühne <fkuehne@videolan.org>
Sat, 8 Feb 2014 15:52:12 +0000 (16:52 +0100)
(cherry picked from commit dcfe8660d41dbb2b519949ff767c7088a969525a)
Signed-off-by: Felix Paul Kühne <fkuehne@videolan.org>
src/network/tcp.c

index 9e0442c..37376f9 100644 (file)
@@ -348,17 +348,14 @@ static int SocksNegotiate( vlc_object_t *p_obj,
         return VLC_SUCCESS;
 
     /* We negotiate authentication */
-
-    if( ( psz_socks_user == NULL ) && ( psz_socks_passwd == NULL ) )
-        b_auth = true;
-
     buffer[0] = i_socks_version;    /* SOCKS version */
-    if( b_auth )
+    if( psz_socks_user != NULL && psz_socks_passwd != NULL )
     {
         buffer[1] = 2;                  /* Number of methods */
         buffer[2] = 0x00;               /* - No auth required */
         buffer[3] = 0x02;               /* - USer/Password */
         i_len = 4;
+        b_auth = true;
     }
     else
     {