lua-users home
lua-l archive

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


hi

in luasql-2.0.0, ls_oci8.c, free_column_buffers() has a line 251
reading "case SQLT_NUM: /* NUM is an array of char */"
resulting in a free on the char *s of union column_value.

Well, since SQLT_NUM is *not* an array of char in this
implementation (and this file uses the union's double
value in a couple of other places for SQLT_NUM),
this crashes occasionally on cursor close.

This case must be moved a line up next to case SQLT_FLT,
which does not free zilch, then everything's fine.


salud
Klaus
*** ls_oci8.c.orig	Wed Mar 23 00:55:20 2005
--- ls_oci8.c	Sat Jul 16 23:53:00 2005
***************
*** 247,254 ****
  	switch (col->type) {
  		case SQLT_INT:
  		case SQLT_FLT:
  			break;
- 		case SQLT_NUM: /* NUM is an array of char */
  		case SQLT_CHR:
  		case SQLT_STR:
  		case SQLT_VCS:
--- 247,254 ----
  	switch (col->type) {
  		case SQLT_INT:
  		case SQLT_FLT:
+ 		case SQLT_NUM: /* NUM is *NOT* an array of char */
  			break;
  		case SQLT_CHR:
  		case SQLT_STR:
  		case SQLT_VCS: