From 884771e3b5a3c810471f29b3f73124ed4d73b985 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Fri, 3 Jun 2016 12:12:45 +0200 Subject: [PATCH 1/2] browser: do not segfault when the returned path is NULL --- src/browser.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/browser.c b/src/browser.c index 7fda929..2681659 100644 --- a/src/browser.c +++ b/src/browser.c @@ -77,6 +77,11 @@ char *do_browser(char *path) path = mallocstrassn(path, get_full_path(path)); + if (path == NULL) { + statusline(ALERT, "Directory is inaccessible"); + path = mallocstrcpy(NULL, present_path); + } + /* Save the current path in order to be used later. */ present_path = mallocstrcpy(present_path, path); -- 2.8.1