Opened 11 years ago

Last modified 11 years ago

#5734 assigned Bugs

possible handle leak in posix implementation copy_file_api

Reported by: alexey.kutumov@… Owned by: Beman Dawes
Milestone: Boost 1.48.0 Component: filesystem
Version: Boost 1.47.0 Severity: Problem
Keywords: filesystem copy_file Cc:

Description

There is possible handle leak in POSIX implementation of function copy_file_api.

...
    if ((infile = ::open(from_p.c_str(), O_RDONLY))< 0)
      { return false; }

    struct stat from_stat;
    if (::stat(from_p.c_str(), &from_stat)!= 0)
      { return false; }
...

if ::stat failed, then function exits without closing infile handle.

This problem exists both in v3 and v2 implementations of filesystem. Also this problem exists in previous releases.

Change History (1)

comment:1 by Beman Dawes, 11 years ago

Status: newassigned
Note: See TracTickets for help on using tickets.