From aaa6670eda5da849eee3c29e5fa5b7e0a7cf004e Mon Sep 17 00:00:00 2001 From: Albert S Date: Sat, 26 Sep 2020 18:42:27 +0200 Subject: [PATCH] check whether entry is file. avoids 'raou .' panic --- src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.rs b/src/main.rs index 7fdc60e..65471e7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -262,6 +262,12 @@ fn exec(entryname: &str, cmdargs: &Vec) -> std::io::Result<()> { "Specified entry is outside base directory", )); } + if ! p.is_file() { + return Err(std::io::Error::new( + ErrorKind::Other, + "Error: Entry not a file", + )); + } } Err(e) => { if e.kind() == ErrorKind::NotFound {