all repos — fluxbox @ 39b34a9109ca2a995bbe46a365efa105ecbdf968

custom fork of the fluxbox windowmanager

fix segfault when completing ~ or .

ie. w/o any / in the given path we'll get an irregular split point and
thus out of bounds array access
Thomas Lübking thomas.luebking@gmail.com
commit

39b34a9109ca2a995bbe46a365efa105ecbdf968

parent

facb42fc3537a8a1288b3da38b38fa533ac1d309

1 files changed, 4 insertions(+), 0 deletions(-)

jump to
M util/fbrun/FbRun.ccutil/fbrun/FbRun.cc

@@ -462,6 +462,10 @@ }

if (prefix.at(0) == '/' || prefix.at(0) == '.' || prefix.at(0) == '~') { // we're completing a directory, find subdirs split = prefix.find_last_of('/'); + if (split == std::string::npos) { + split = prefix.size(); + prefix.append("/"); + } prefix = prefix.substr(0, split+1); if (prefix != m_last_completion_path) { m_files.clear();