Opened 14 years ago
Closed 14 years ago
#2106 closed Bugs (invalid)
oversight in "boost::filesystem::path::operator /"
Reported by: | Owned by: | Beman Dawes | |
---|---|---|---|
Milestone: | Component: | filesystem | |
Version: | Boost 1.35.0 | Severity: | Problem |
Keywords: | Cc: |
Description
Using "boost::filesystem::path::operator /" with "const char*" or "const string&" as parameter is dangerous because the temporary object of type "path" is create but without control of the name's checking parameter. For example: you can write this code "string filePath = (fs::path(pathName, fs::no_check) / fileName).string();" and expect both "pathName" and "fileName" not to be checked against rules. In fact only "pathName" will not be checked but "fileName" will be checked with default checker. Thus you will receive, unexpected and unhandled, "boost::filesystem::filesystem_error" exception.
The name check on construction has been eliminated. Users complained it was excessively nannyish. Thus there is no longer any issue so I am closing the ticket.
--Beman