Re: [PATCH v2 1/5] ptp-gadget: Fix issue in enum_object

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

 



On Fri, 9 Apr 2010, Anatolij Gustschin wrote:

> Sometimes not all objects from the image directory are
> imported. Removing this dentry->d_name zero-termination
> seems to fix the problem. dentry->d_name is zero-terminated,
> no need to terminate it.

Sorry, do not understand. The only possibility for this is if the name 
doesn't fit, and then it overwrites following fields in dentry... So, I'm 
hesitant to accept this fix. Can you verify exactly which cases fail? on 
which files?

> Signed-off-by: Anatolij Gustschin <agust@xxxxxxx>
> ---
>  ptp.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
> 
> diff --git a/ptp.c b/ptp.c
> index 4c4b383..b887176 100644
> --- a/ptp.c
> +++ b/ptp.c
> @@ -2019,7 +2019,6 @@ static int enum_objects(const char *path)
>  		enum pima15740_data_format format;
>  		struct tm mod_tm;
>  
> -		dentry->d_name[sizeof(dentry->d_name) - 1] = '\0';
>  		dot = strrchr(dentry->d_name, '.');
>  
>  		if (!dot || dot == dentry->d_name)
> -- 
> 1.6.3.3

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux