Fixed a crash bug when hlink_list is NULL and a link_u.links
authorWayne Davison <wayned@samba.org>
Fri, 26 Mar 2004 16:46:20 +0000 (16:46 +0000)
committerWayne Davison <wayned@samba.org>
Fri, 26 Mar 2004 16:46:20 +0000 (16:46 +0000)
pointer in one of the file_struct nodes is not.

hlink.c

diff --git a/hlink.c b/hlink.c
index 110e6ed..3ee8433 100644 (file)
--- a/hlink.c
+++ b/hlink.c
@@ -135,7 +135,7 @@ void init_hard_links(struct file_list *flist)
 
 int hard_link_check(struct file_struct *file, int skip)
 {
-       if (!file->link_u.links)
+       if (!hlink_list || !file->link_u.links)
                return 0;
        if (skip && !(file->flags & FLAG_HLINK_EOL))
                hlink_list[file->F_HLINDEX] = file->F_NEXT;