summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@stoeckmann.org>2021-07-23 18:36:22 +0200
committerDaniel Friesel <derf@chaosdorf.de>2021-07-23 20:27:36 +0200
commita426af8058bc7982a0004e78ee833f61f5633a33 (patch)
tree24593e9af390c8ed01f85c314d2088e432a2f216
parent728334b013c459438d2f92b78931a7c3b6a715c3 (diff)
Fix out of boundary access on illegal argument
Calling feh with an empty argument leads to out of boundary access. This can be seen best when compiled with asan: $ feh ""
-rw-r--r--src/filelist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/filelist.c b/src/filelist.c
index 49355c4..e70e003 100644
--- a/src/filelist.c
+++ b/src/filelist.c
@@ -202,7 +202,7 @@ void add_file_to_filelist_recursively(char *origpath, unsigned char level)
struct stat st;
char *path;
- if (!origpath)
+ if (!origpath || *origpath == '\0')
return;
path = estrdup(origpath);