CVS: rdesktop xwin.c,1.198,1.199

Peter Åstrand <[email protected]>
Newsgroups gmane.network.rdesktop.cvs
Message-ID <[email protected]>
Update of /cvsroot/rdesktop/rdesktop
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4046

Modified Files:
	xwin.c 
Log Message:
Another try at the fix for short 0xff and 0xfe commands:

* On short commands, print a warning as well as a debug string. 

* For 0xfe, allow one byte commands. In this case, do not increment
  x/y; assume that the third byte is zero.


Index: xwin.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/xwin.c,v
retrieving revision 1.198
retrieving revision 1.199
diff -C2 -d -r1.198 -r1.199
*** xwin.c	23 Nov 2005 12:49:37 -0000	1.198
--- xwin.c	23 Nov 2005 13:26:29 -0000	1.199
***************
*** 2446,2452 ****
  		{
  			case 0xff:
  				if (i + 3 > length)
  				{
! 					/* short command, skip */
  					i = length = 0;
  					break;
--- 2446,2456 ----
  		{
  			case 0xff:
+ 				/* At least two bytes needs to follow */
  				if (i + 3 > length)
  				{
! 					warning("Skipping short 0xff command:");
! 					for (j = 0; j < length; j++)
! 						fprintf(stderr, "%02x ", text[j]);
! 					fprintf(stderr, "\n");
  					i = length = 0;
  					break;
***************
*** 2461,2467 ****
  
  			case 0xfe:
! 				if (i + 3 > length)
  				{
! 					/* short command, skip */
  					i = length = 0;
  					break;
--- 2465,2475 ----
  
  			case 0xfe:
! 				/* At least one byte needs to follow */
! 				if (i + 2 > length)
  				{
! 					warning("Skipping short 0xfe command:");
! 					for (j = 0; j < length; j++)
! 						fprintf(stderr, "%02x ", text[j]);
! 					fprintf(stderr, "\n");
  					i = length = 0;
  					break;
***************
*** 2470,2475 ****
  				if (entry->data != NULL)
  				{
! 					if ((((uint8 *) (entry->data))[1] ==
! 					     0) && (!(flags & TEXT2_IMPLICIT_X)))
  					{
  						if (flags & TEXT2_VERTICAL)
--- 2478,2483 ----
  				if (entry->data != NULL)
  				{
! 					if ((((uint8 *) (entry->data))[1] == 0)
! 					    && (!(flags & TEXT2_IMPLICIT_X)) && (i + 2 < length))
  					{
  						if (flags & TEXT2_VERTICAL)
***************
*** 2481,2485 ****
  						DO_GLYPH(((uint8 *) (entry->data)), j);
  				}
! 				i += 3;
  				length -= i;
  				/* this will move pointer from start to first character after FE command */
--- 2489,2496 ----
  						DO_GLYPH(((uint8 *) (entry->data)), j);
  				}
! 				if (i + 2 < length)
! 					i += 3;
! 				else
! 					i += 2;
  				length -= i;
  				/* this will move pointer from start to first character after FE command */



-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.