fixed a segv bug when handling symlinks.
[rsync/rsync.git] / generator.c
index 5321d8a..886c672 100644 (file)
@@ -234,7 +234,7 @@ void recv_generator(char *fname,struct file_list *flist,int i,int f_out)
                        l = readlink(fname,lnk,MAXPATHLEN-1);
                        if (l > 0) {
                                lnk[l] = 0;
-                               if (strcmp(lnk,file->link) == 0) {
+                               if (file->link && strcmp(lnk,file->link) == 0) {
                                        set_perms(fname,file,&st,1);
                                        return;
                                }