Re: [PATCH] btrfs-progs: Fix segmentation fault

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jun 22, 2013 at 02:39:21PM +0900, Kusanagi Kouichi wrote:
> @@ -224,12 +224,10 @@ again:
>  		goto out;
>  	}
>  
> -	cpath = realpath(path, 0);
> -	dname = strdup(cpath);
> +	dname = strdup(path);

We want realpath() here, and when it returns NULL, there was an
error that should be handled like in other cases where realpath is
used.

>  	dname = dirname(dname);
> -	vname = strdup(cpath);
> +	vname = strdup(path);
>  	vname = basename(vname);
> -	free(cpath);
>  
>  	if( !strcmp(vname,".") || !strcmp(vname,"..") ||
>  	     strchr(vname, '/') ){
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux