libstdc++: Fix out-of-bounds string_view access in filesystem::path [PR 97167]
authorJonathan Wakely <jwakely@redhat.com>
Tue, 22 Sep 2020 19:02:58 +0000 (20:02 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 22 Sep 2020 19:02:58 +0000 (20:02 +0100)
commit49ff88bd0d8a36a9e903f01ce05685cfe07dee5d
treecb98506a941642825651753585aa5e5b41065cab
parent809192e77e6e112a0fe32dee7fada7a49fbf25cd
libstdc++: Fix out-of-bounds string_view access in filesystem::path [PR 97167]

libstdc++-v3/ChangeLog:

PR libstdc++/97167
* src/c++17/fs_path.cc (path::_Parser::root_path()): Check
for empty string before inspecting the first character.
* testsuite/27_io/filesystem/path/append/source.cc: Append
empty string_view to path.
libstdc++-v3/src/c++17/fs_path.cc
libstdc++-v3/testsuite/27_io/filesystem/path/append/source.cc