Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#50 Blat vs2005 (2.6.2) may crash on failed connection

closed
nobody
None
5
2012-03-10
2009-05-26
Felix Oberli
No

Bug in gensock_connect(..)

If retval = conn->get_connected (hostname, service) in the section below fails to connect, then the code runs twice through the destructor of the same connection class (conn) object (once in 'gensock_close(conn);' and once in 'delete conn;'. This may crash the program.
...
retval = conn->get_connected (hostname, service);
if ( retval ) {
gensock_close(conn);
delete conn;
*pst = 0;
return(retval);
}
...

Destructor of connection class 'conn' object:

connection::~connection (void)
{
delete [] in_buffer;
delete [] out_buffer;
}

Discussion

  • Felix Oberli
    Felix Oberli
    2009-05-26

    • summary: Blat vs2005 (2.6.1) may crash on failed connection --> Blat vs2005 (2.6.2) may crash on failed connection
     
  • tbeu
    tbeu
    2011-10-28

    Changing to
    ...
    if (gensock_close(conn))
    delete conn;
    ...
    solves the problem.

     
  • Chip
    Chip
    2011-10-30

    The problem is resolved with version 2.7.6. I did not see this message until now.

     
  • tbeu
    tbeu
    2011-11-07

    Fix confirmed in 2.7.6. Can you please close this ticket.

     
  • Chip
    Chip
    2012-03-10

    • status: open --> closed