summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index 66ae90f..636eded 100644
--- a/src/util.c
+++ b/src/util.c
@@ -466,6 +466,13 @@ move_file (char const *from, bool *from_needs_removal,
read_fatal ();
buffer[size] = 0;
+ if (! symlink_target_is_valid (buffer, to))
+ {
+ fprintf (stderr, "symbolic link target '%s' is invalid\n",
+ buffer);
+ fatal_exit (0);
+ }
+
if (! backup)
{
if (unlink (to) == 0)