[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[coldsync-hackers] Fix for core dump using SPC.



Hello,
If a conduit sends an SPC message with zero length, coldsync will try to free()
its buffer twice, resulting in a SIGSEGV.

A patch to fix this is attached.

-- Fred GC.


-- 
----------------------------------------------------------------------
	    Fred Gylys-Colwell      fredgc@member.ams.org
*** coldsync-2.2.0-orig/src/conduit.c	Wed Aug 15 08:27:34 2001
--- coldsync-2.2.0/src/conduit.c	Thu Sep  6 21:04:37 2001
***************
*** 879,885 ****
--- 889,898 ----
  
  			/* We're done with spc_inbuf */
  			if (spc_inbuf != NULL)
+ 			{
  				free(spc_inbuf);
+ 				spc_inbuf = NULL; /* don't free it again. */
+ 			}
  			spc_towrite = spc_req.len;
  
  			/* Error-checking */