Merge pull request #186 from celsius/master

add cmake option for redirection debug and fix a segmentation fault in redirection.c
This commit is contained in:
Marc-André Moreau 2011-10-26 10:24:06 -07:00
commit 194045b62a
3 changed files with 8 additions and 5 deletions

View File

@ -18,3 +18,4 @@ option(WITH_MANPAGES "Generate manpages." ON)
option(WITH_PROFILER "Compile profiler." OFF)
option(WITH_SSE2 "Use SSE2 optimization." OFF)
option(WITH_SSE2_TARGET "Allow compiler to generate SSE2 instructions." OFF)
option(WITH_DEBUG_REDIR "Redirection debug messages" OFF)

View File

@ -37,5 +37,6 @@
#cmakedefine WITH_DEBUG_XV
#cmakedefine WITH_DEBUG_SCARD
#cmakedefine WITH_DEBUG_ORDERS
#cmakedefine WITH_DEBUG_REDIR
#endif

View File

@ -138,12 +138,13 @@ boolean rdp_recv_server_redirection_pdu(rdpRdp* rdp, STREAM* s)
redirection->targetNetAddresses = (rdpString*) xzalloc(count * sizeof(rdpString));
while (count > 0)
int i;
for (i=0; i < count; i++)
{
freerdp_string_read_length32(s, redirection->targetNetAddresses, rdp->settings->uniconv);
DEBUG_REDIR("targetNetAddresses: %s", redirection->targetNetAddresses->ascii);
redirection->targetNetAddresses++;
count--;
freerdp_string_read_length32(s, &redirection->targetNetAddresses[i], rdp->settings->uniconv);
DEBUG_REDIR("targetNetAddresses: %s", (&redirection->targetNetAddresses[i])->ascii);
}
}