Skip to Content.
Sympa Menu

freetds - [freetds] Deref null pointer in odbc_util.c

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Chad Jones <cjones AT simdesk.com>
  • To: freetds AT lists.ibiblio.org
  • Subject: [freetds] Deref null pointer in odbc_util.c
  • Date: Mon, 01 Aug 2005 11:46:26 -0500

Hello,

I recently came across a case while working on a unixodbc client using
freetds that led to attempting to dereference a null pointer in
odbc_set_return_params. Unfortunately, I can't remember the exact
circumstances, but attached is the simple patch of checking the pointer
before using it.

--Chad


Index: odbc_util.c
===================================================================
RCS file: /cvsroot/freetds/freetds/src/odbc/odbc_util.c,v
retrieving revision 1.82
diff -c -r1.82 odbc_util.c
*** odbc_util.c 24 Jul 2005 15:25:26 -0000 1.82
--- odbc_util.c 1 Aug 2005 16:40:19 -0000
***************
*** 198,204 ****
return /* SQL_ERROR */ ;
if (drec_apd->sql_desc_indicator_ptr)
*drec_apd->sql_desc_indicator_ptr = 0;
! *drec_apd->sql_desc_octet_length_ptr = len;
}
}

--- 198,205 ----
return /* SQL_ERROR */ ;
if (drec_apd->sql_desc_indicator_ptr)
*drec_apd->sql_desc_indicator_ptr = 0;
! if (drec_apd->sql_desc_octet_length_ptr)
! *drec_apd->sql_desc_octet_length_ptr = len;
}
}





Archive powered by MHonArc 2.6.24.

Top of Page