Hi,

    found a little bug in libpgtcl/pgtclCmds.c causing a
    segmentation fault. Please apply.


Jan

-- 

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#======================================== jwieck@debis.com (Jan Wieck) #

*** pgtclCmds.c.orig	Thu Oct  1 09:15:11 1998
--- pgtclCmds.c	Thu Oct  1 12:59:59 1998
***************
*** 241,258 ****
  {
  	PQconninfoOption *option;
  	char		buf[8192];
  
  	Tcl_ResetResult(interp);
  	for (option = PQconndefaults(); option->keyword != NULL; option++)
  	{
! 		if (option->val == NULL)
! 			option->val = "";
  		sprintf(buf, "{%s} {%s} {%s} %d {%s}",
  				option->keyword,
  				option->label,
  				option->dispchar,
  				option->dispsize,
! 				option->val);
  		Tcl_AppendElement(interp, buf);
  	}
  
--- 241,258 ----
  {
  	PQconninfoOption *option;
  	char		buf[8192];
+ 	char		*val;
  
  	Tcl_ResetResult(interp);
  	for (option = PQconndefaults(); option->keyword != NULL; option++)
  	{
! 		val = (option->val == NULL) ? "" : option->val;
  		sprintf(buf, "{%s} {%s} {%s} %d {%s}",
  				option->keyword,
  				option->label,
  				option->dispchar,
  				option->dispsize,
! 				val);
  		Tcl_AppendElement(interp, buf);
  	}
  

Thu, 1 Oct 1998 13:06:42 +0200 (MET DST)
jwieck@debis.com (Jan Wieck)
Patch for libpgtcl
jwieck@debis.com (Jan Wieck) writes:
>     found a little bug in libpgtcl/pgtclCmds.c causing a
>     segmentation fault. Please apply.

Patch applied.  That routine had other problems too: it would fail if
any of the values contained characters that are special in a Tcl list.
All better now...

			regards, tom lane

Thu, 01 Oct 1998 21:42:01 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] Patch for libpgtcl 