cURL / Mailing Lists / curl-library / Single Mail

curl-library

[ curl-Bugs-1124588 ] Bug managing file descriptors

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Thu, 17 Feb 2005 01:18:12 -0800

Bugs item #1124588, was opened at 2005-02-17 01:18
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1124588&group_id=976

Category: libcurl
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Daniel Stenberg (bagder)
Summary: Bug managing file descriptors

Initial Comment:
   Hello,

   I have encountered a little bug in libcurl source code
(all versions) that causes process file descriptors may be
lost. In libcurl v7.13.0 (line 642 in "connect.c" file) there
is this code in "singleipconnect()" function:

    CURLcode res = bindlocal(conn, sockfd);
    if(res)
      return res;

   If the bind system call fails, then the socket
descriptor previously created (line 623) wasn't closed,
so this file descriptor will never be used after by this pid.
   I think the bug can be patched changing those three
lines by these:

    CURLcode res = bindlocal(conn, sockfd);
    if(res) {
      sclose(sockfd);
      return res;
    }

   David

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

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1124588&group_id=976
Received on 2005-02-17