/[rdesktop]/sourceforge.net/trunk/rdesktop/rdp.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/rdp.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1428 by matthewc, Sat Jan 5 05:43:02 2008 UTC revision 1429 by astrand, Thu Jan 24 08:06:02 2008 UTC
# Line 246  int Line 246  int
246  rdp_in_unistr(STREAM s, char *string, int str_size, int in_len)  rdp_in_unistr(STREAM s, char *string, int str_size, int in_len)
247  {  {
248  #ifdef HAVE_ICONV  #ifdef HAVE_ICONV
249          size_t ibl = in_len, obl = str_size-1;          size_t ibl = in_len, obl = str_size - 1;
250          char *pin = (char *) s->p, *pout = string;          char *pin = (char *) s->p, *pout = string;
251          static iconv_t iconv_h = (iconv_t) - 1;          static iconv_t iconv_h = (iconv_t) - 1;
252    
# Line 291  rdp_in_unistr(STREAM s, char *string, in Line 291  rdp_in_unistr(STREAM s, char *string, in
291  #endif  #endif
292          {          {
293                  int i = 0;                  int i = 0;
294                  int len = in_len/2;                  int len = in_len / 2;
295                  int rem = 0;                  int rem = 0;
296    
297                  if (len > str_size-1)                  if (len > str_size - 1)
298                  {                  {
299                          warning("server sent an unexpectedly long string, truncating\n");                          warning("server sent an unexpectedly long string, truncating\n");
300                          len = str_size-1;                          len = str_size - 1;
301                          rem = in_len - 2*len;                          rem = in_len - 2 * len;
302                  }                  }
303    
304                  while (i < len)                  while (i < len)
# Line 1350  process_redirect_pdu(STREAM s /*, uint32 Line 1350  process_redirect_pdu(STREAM s /*, uint32
1350          in_uint32_le(s, len);          in_uint32_le(s, len);
1351    
1352          /* read cookie string (plain ASCII) */          /* read cookie string (plain ASCII) */
1353          if (len > sizeof(g_redirect_cookie)-1)          if (len > sizeof(g_redirect_cookie) - 1)
1354          {          {
1355                  uint32 rem = len - (sizeof(g_redirect_cookie)-1);                  uint32 rem = len - (sizeof(g_redirect_cookie) - 1);
1356                  len = sizeof(g_redirect_cookie)-1;                  len = sizeof(g_redirect_cookie) - 1;
1357    
1358                  warning("Unexpectedly large redirection cookie\n");                  warning("Unexpectedly large redirection cookie\n");
1359                  in_uint8a(s, g_redirect_cookie, len);                  in_uint8a(s, g_redirect_cookie, len);

Legend:
Removed from v.1428  
changed lines
  Added in v.1429

  ViewVC Help
Powered by ViewVC 1.1.26