lkml.org 
[lkml]   [2014]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/1] hfsplus: fix longname handling
From
Date
On Tue, 2014-02-25 at 12:05 +0200, sougata santra wrote:

> return err;
> >> +
> >> + len = be16_to_cpu(key->cat.name.length);
> >> key->key_len = cpu_to_be16(6 + 2 * len);
> >
> > I think that maybe it is time to change hardcoded 6 on sensible named
> > constant. What do you think?
>
> I agree, although I think this should he done in a separate patch. Also
> there are other instances of hard-coding. We can clean them with a patch. ?
>

Yes, I think so too. It will be great.

> > 62
> > 63 ustrlen = be16_to_cpu(name->length);
> >
> > I suppose that it makes sense to check name->length here and return
> > error. We can check possible volume corruption here.
>
> I looked into it while writing the patch. I think this was already
> handled before. Please see. catalog.c#hfsplus_find_cat the only place it
> is called.
>
> {code}
> if (be16_to_cpu(tmp.thread.nodeName.length) > 255) {
> pr_err("catalog name length corrupted\n");
> return -EIO;
> }
> {code}
>

OK. I agree that my suggestion is not necessary.

Thanks,
Vyacheslav Dubeyko.




\
 
 \ /
  Last update: 2014-02-25 12:01    [W:0.068 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site