From: Csaba H. <csa...@cr...> - 2006-06-03 23:19:03
|
On 2006-06-03, Remy Blank <rem...@po...> wrote: > Index: lib/helper.c >=================================================================== > --- lib/helper.c (revision 1872) > +++ lib/helper.c (revision 1875) > @@ -148,10 +148,17 @@ int fuse_parse_cmdline(struct fuse_args > if (res == -1) > goto err; > } > - if (mountpoint) > - *mountpoint = hopts.mountpoint; > - else > - free(hopts.mountpoint); > + if (mountpoint) { > + if (hopts.mountpoint) { > + *mountpoint = malloc(PATH_MAX + 1); > + if(!realpath(hopts.mountpoint, *mountpoint)) { > + strncpy(*mountpoint, hopts.mountpoint, PATH_MAX); > + (*mountpoint)[PATH_MAX] = 0; > + } > + } else > + *mountpoint = NULL; > + } > + free(hopts.mountpoint); > > if (multithreaded) > *multithreaded = !hopts.singlethread; > - Handle potential malloc failure. - Free mountpoint in umount routine (or elsewhere if we can escape without hitting fuse_unmount). Regards, Csaba |