Chris Browne cbbrowne at lists.slony.info
Mon Feb 23 11:08:26 PST 2009
Update of /home/cvsd/slony1/slony1-engine/src/backend
In directory main.slony.info:/tmp/cvs-serv10398

Modified Files:
	slony1_funcs.c 
Log Message:
Applied patch from bug #67
http://www.slony.info/bugzilla/show_bug.cgi?id=67

-----
I attached a small patch against slony1_funcs.c which checks for the 0
byte at the end of the attkind string and stops the iteration. This
patch also adds some error checking in the loop beginning in line 648.
Of course the problem can be removed by not trimming the string in the
determineAttkindUnique(text, name) function, but I think that the end
of a zero-terminated string should be checked in any case.
-----

Thanks to Adam Buraczewski...



Index: slony1_funcs.c
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/src/backend/slony1_funcs.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -C2 -d -r1.68 -r1.69
*** slony1_funcs.c	24 Sep 2008 19:54:09 -0000	1.68
--- slony1_funcs.c	23 Feb 2009 19:08:24 -0000	1.69
***************
*** 652,655 ****
--- 652,658 ----
  
  				attkind_idx++;
+ 				if (!attkind[attkind_idx])
+ 					elog(ERROR, "Slony-I: no key columns found in logTrigger() attkind parameter");
+ 
  				if (attkind[attkind_idx] == 'k')
  					break;
***************
*** 695,698 ****
--- 698,703 ----
  
  			attkind_idx++;
+ 			if (!attkind[attkind_idx])
+ 				break;
  			if (attkind[attkind_idx] != 'k')
  				continue;
***************
*** 762,765 ****
--- 767,772 ----
  
  			attkind_idx++;
+ 			if (!attkind[attkind_idx])
+ 				break;
  			if (attkind[attkind_idx] != 'k')
  				continue;



More information about the Slony1-commit mailing list