Skip to Content.
Sympa Menu

freetds - Re: [freetds] Error in tds_check_socket_write()

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "ZIGLIO, Frediano, VF-IT" <Frediano.Ziglio AT vodafone.com>
  • To: "Sergey A. Cherukhin" <rf AT ce.cctpu.edu.ru>, "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Error in tds_check_socket_write()
  • Date: Fri, 23 Sep 2005 13:47:40 +0200

>
> Hello freetds,
>
> I have found error in freetds-0.63, which result in segmentation fault
> when tds_check_socket_write() called with negative socket file
> descriptor. See patch below.
>
> *** freetds-0.63-cvs/src/tds/write.c Thu Jul 29 18:22:42 2004
> --- freetds-0.63/src/tds/write.c Fri Sep 23 14:57:06 2005
> ***************
> *** 277,290 ****
> --- 277,293 ----
> tds_check_socket_write(TDSSOCKET * tds)
> {
> int retcode = 0;
> struct timeval selecttimeout;
> time_t start, now;
> fd_set fds;
>
> + if (tds->s < 0)
> + return -1; /* Fix of SIGSEGV when FD_SET()
> called with negative fd (S. Cherukhin, 23/09/2005) */
> +
> /* Jeffs hack *** START OF NEW CODE */
> FD_ZERO(&fds);
>
> if (!tds->timeout) {
> for (;;) {
> FD_SET(tds->s, &fds);
> retcode = select(tds->s + 1, NULL,
> &fds, NULL, NULL);
>

This should happen if connection got broken.
Accepted and applied. http://freetds.sourceforge.net/post63.diff.gz for
patch post 0.63.

freddy77




Archive powered by MHonArc 2.6.24.

Top of Page