Skip to content

find_include_file incorrectly accepts directories as include files #243

@Rac75116

Description

@Rac75116

https://github.com/boostorg/wave/blob/develop/include/boost/wave/util/cpp_include_paths.hpp#L331
https://github.com/boostorg/wave/blob/develop/include/boost/wave/util/cpp_include_paths.hpp#L365

boost::wave::utils::include_paths::find_include_file validates a candidate include path using boost::filesystem::exists. Because exists also returns true for directories, subsequent code that expects a file may attempt to open a directory and encounter a runtime error. Replacing exists with boost::filesystem::is_regular_file would ensure only regular files are accepted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions