Skip to Content.
Sympa Menu

freetds - segfault in src/ctlib/ctutil.c:83

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Daniel Drown <dan-freetds AT drown.org>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: segfault in src/ctlib/ctutil.c:83
  • Date: Thu, 14 Nov 2002 13:52:47 -0500

The following code dereferences a NULL pointer in ctutil.c

if (!con) {
ctx = (CS_CONTEXT *) ctx_tds->parent;
if (ctx->_servermsg_cb)
ret = ctx->_servermsg_cb(con->ctx,con,&errmsg);
^^^^^^^^

attached is a simple patch to call servermsg_cb with a null context in this
case

--
It's looking like if MySQL AB doesn't make a movie based on the manual,
nobody's ever gonna learn how to use a database.
- r.
--- src/ctlib/ctutil.c.orig Wed Nov 13 14:47:54 2002
+++ src/ctlib/ctutil.c Wed Nov 13 14:47:17 2002
@@ -80,7 +80,7 @@
if (!con) {
ctx = (CS_CONTEXT *) ctx_tds->parent;
if (ctx->_servermsg_cb)
- ret = ctx->_servermsg_cb(con->ctx,con,&errmsg);
+ ret = ctx->_servermsg_cb(NULL,con,&errmsg);
} else if (con->_servermsg_cb)
ret = con->_servermsg_cb(con->ctx,con,&errmsg);
else if (con->ctx->_servermsg_cb)



Archive powered by MHonArc 2.6.24.

Top of Page