Skip to Content.
Sympa Menu

freetds - [freetds] [ freetds-Patches-753288 ] Fix: int cast-and-deref in ODBC error.c.

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "SourceForge.net" <noreply AT sourceforge.net>
  • To: noreply AT sourceforge.net
  • Cc:
  • Subject: [freetds] [ freetds-Patches-753288 ] Fix: int cast-and-deref in ODBC error.c.
  • Date: Thu, 12 Jun 2003 07:02:40 -0700

Patches item #753288, was opened at 2003-06-12 15:50
Message generated for change (Comment added) made by freddy77
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=407808&aid=753288&group_id=33106

Category: odbc
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Gerhard Esterhuizen (gmpff)
Assigned to: Nobody/Anonymous (nobody)
Summary: Fix: int cast-and-deref in ODBC error.c.

Initial Comment:
In the nightly sources from 12/06/2003,
/src/odbc/error.c, line 404 we have:

*(SQLINTEGER *) buffer = *(SQLINTEGER *)
tsock->res_info->row_count;

This is a bug as tsock->res_info->row_count is a
TDS_INT containing the number of result rows and should
therefore not be cast to a pointer and dereferenced.
This causes segfaults when executing queries (using
SQLExecute) that returned no results (resulting in a
NULL pointer being dereferenced).

I fixed this by changing the line to:

*(SQLINTEGER *) buffer = tsock->res_info->row_count;

A patch against nightly source 12062003 is attached.

Regards,

gerhard.



----------------------------------------------------------------------

>Comment By: Frediano Ziglio (freddy77)
Date: 2003-06-12 16:02

Message:
Logged In: YES
user_id=75766

Applyed

----------------------------------------------------------------------

Comment By: Gerhard Esterhuizen (gmpff)
Date: 2003-06-12 15:55

Message:
Logged In: YES
user_id=698709

I forgot to check the file attach box. Please forgive me for
being an idiot. Here it is attached now.


g.


----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=407808&aid=753288&group_id=33106




Archive powered by MHonArc 2.6.24.

Top of Page