[ rdesktop-Bugs-3428380 ] session redirection broken in 1.7.0

SourceForge.net <[email protected]> Wed, 26 Oct 2011 11:50:20 +0200
Newsgroups gmane.network.rdesktop.devel
Message-ID <[email protected]>
Bugs item #3428380, was opened at 2011-10-25 22:21
Message generated for change (Comment added) made by m_etscheid
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=381347&aid=3428380&group_id=24366

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Authentication
Group: v1.7.1
Status: Open
Resolution: None
>Priority: 7
Private: No
Submitted By: m_etscheid (m_etscheid)
Assigned to: Nobody/Anonymous (nobody)
>Summary: session redirection broken in 1.7.0

Initial Comment:
Hi,

the support for session redirection for W2003 is broken in 1.7.0. The RDP redirect paket does not contain the complete user name. 
Version 1.6.0 works fine.

----------------------------------------------------------------------

>Comment By: m_etscheid (m_etscheid)
Date: 2011-10-26 11:50

Message:
Found following changes:


--- rdesktop-1.7.0.org/rdp.c	2011-04-18 04:21:57.000000000 -0700
+++ rdesktop-1.7.0/rdp.c	2011-10-26 01:01:00.789038907 -0700
@@ -1520,7 +1520,7 @@
 
 		/* read username string */
 		g_redirect_username = (char *) xmalloc(len + 1);
-		rdp_in_unistr(s, g_redirect_username, strlen(g_redirect_username),
len);
+		rdp_in_unistr(s, g_redirect_username, len + 1, len);
 	}
 
 	if (g_redirect_flags & PDU_REDIRECT_HAS_DOMAIN)


--- rdesktop-1.7.0.org/rdesktop.c	2011-04-18 04:21:57.000000000 -0700
+++ rdesktop-1.7.0/rdesktop.c	2011-10-26 00:58:33.445042788 -0700
@@ -988,7 +988,7 @@
 			STRNCPY(domain, g_redirect_domain, sizeof(domain));
 			xfree(g_username);
 			g_username = (char *) xmalloc(strlen(g_redirect_username) + 1);
-			STRNCPY(g_username, g_redirect_username, sizeof(g_username));
+			STRNCPY(g_username, g_redirect_username, strlen(g_redirect_username) +
1);
 			STRNCPY(password, g_redirect_password, sizeof(password));
 			STRNCPY(server, g_redirect_server, sizeof(server));
 			flags |= RDP_LOGON_AUTO;




----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=381347&aid=3428380&group_id=24366

------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev