Opened 10 years ago

#7202 new Bugs

filesystem: Function remove_all_aux() with an argument of type system::error_code& can throw exception in case of filesystem error

Reported by: batsun@… Owned by: Beman Dawes
Milestone: To Be Determined Component: filesystem
Version: Boost 1.47.0 Severity: Problem
Keywords: exception, directory_iterator_construct, error_code Cc:

Description

Function remove_all_aux() calls non-exception safe fs::directory_iterator constructor (without argument of system::error_code& type).

For example, in case of free file descriptors lack in filesystem this constructor can throw an exception "Too many open files".

The better way is to use exception-safe overload of fs::directory_iterator constructor (with argument of system::error_code& type).

Possible fix is in attachment.

The issue is actual for any version from 1.47 to 1.50

Attachments (2)

00-exception-safe-directory-iterator.patch (716 bytes ) - added by batsun@… 10 years ago.
patch for boost 1.47
00-exception-safe-directory-iterator.2.patch (1.3 KB ) - added by batsun@… 10 years ago.
correct patch for boost 1.47

Download all attachments as: .zip

Change History (2)

by batsun@…, 10 years ago

patch for boost 1.47

by batsun@…, 10 years ago

correct patch for boost 1.47

Note: See TracTickets for help on using tickets.