From 3fe98e2d46dc10e9d6444e7c5ae704ecbc004ff8 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Fri, 17 Oct 2025 02:32:53 +0200 Subject: Added check --- FICS/copyfile.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/FICS/copyfile.c b/FICS/copyfile.c index 32c1ce3..84836fe 100644 --- a/FICS/copyfile.c +++ b/FICS/copyfile.c @@ -24,6 +24,10 @@ fics_copyfile(const char *p1, const char *p2) strcmp(p1, "") == 0 || strcmp(p2, "") == 0) return false; + if (!is_regular_file(p1)) { + warnx("%s: not a regular file", __func__); + return false; + } if ((fd[0] = open(p1, O_RDONLY)) < 0) { warn("%s: open(%s, ...)", __func__, p1); return false; -- cgit v1.2.3