diff options
Diffstat (limited to '')
-rw-r--r-- | src/input_file.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/input_file.c b/src/input_file.c index 8ed9c3d75..7806e15ab 100644 --- a/src/input_file.c +++ b/src/input_file.c @@ -50,6 +50,13 @@ input_file_open(struct input_stream *is, const char *filename) return false; } + if (!S_ISREG(st.st_mode)) { + g_debug("Not a regular file: %s\n", filename); + is->error = EINVAL; + close(fd); + return false; + } + is->size = st.st_size; #ifdef POSIX_FADV_SEQUENTIAL |