Skip to Content.
Sympa Menu

freetds - Re: New PR/477 entered by dan-freetds@drown.org

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Michael Peppler <mpeppler AT peppler.org>
  • To: dan-freetds AT drown.org
  • Cc: freetds AT franklin.metalab.unc.edu
  • Subject: Re: New PR/477 entered by dan-freetds AT drown.org
  • Date: 19 Nov 2002 13:30:57 -0800

Thanks for the bug report. The question really is whether the server msg
callback can be called with a null connection. As far as I know this
isn't really possible - you will have a valid CS_CONNECTION object
anytime a server callback is called (even if the actual connection to
the database server is closed).

Michael


On Thu, 2002-11-14 at 11:34, dan-freetds AT drown.org wrote:
> New or modifed bug information for Bug ID 477
>
> Category: DBD::Sybase
> Type/Priority: Bug / Medium
> Submitted By: dan-freetds AT drown.org
> Date: Nov 14 2002 11:34AM
> Status: New
> Summary: segfault when servermsg_cb is called with a null connection
> Description:
> dbdimp.c:202, if connection is null, calling ct_con_props probably doesn't
> make any sense (freetds 0.60 segfaults if you do this)
>
> I suggest the following patch to make this case hit the code around line
> 297 (the else statement that matches up with if(imp_dbh &&
> srvmsg->msgnumber))
>
> if this patch doesn't make it through the copy&paste, I have it on:
> http://dan.drown.org/DBD-Sybase-0.94.patch
>
> --- dbdimp.c.orig Wed Nov 13 14:53:32 2002
> +++ dbdimp.c Wed Nov 13 14:55:04 2002
> @@ -175,11 +175,11 @@
> || srvmsg->msgnumber == 5704)
> return CS_SUCCEED;
>
> - if((ct_con_props(connection, CS_GET, CS_USERDATA,
> - &imp_dbh, CS_SIZEOF(imp_dbh), NULL)) != CS_SUCCEED)
> + if(connection && ((ct_con_props(connection, CS_GET, CS_USERDATA,
> + &imp_dbh, CS_SIZEOF(imp_dbh), NULL)) != CS_SUCCEED))
> croak('Panic: servermsg_cb: Can't find handle from connection');
>
> - if(imp_dbh->err_handler) {
> + if(imp_dbh && imp_dbh->err_handler) {
> dSP;
> SV *sv, **svp;
> HV *hv;
>
>
> Log History:
--
Michael Peppler / mpeppler AT peppler.org / http://www.mbay.net/~mpeppler
mpeppler AT zetatools.com / ZetaTools, Inc / http://www.zetatools.com
ZetaTools: Call perl functions as Sybase stored procedures!

Attachment: signature.asc
Description: This is a digitally signed message part



  • Re: New PR/477 entered by dan-freetds AT drown.org, Michael Peppler, 11/19/2002

Archive powered by MHonArc 2.6.24.

Top of Page