1 |
On 22-09-2009 16:11:19 +0200, Markus Duft wrote: |
2 |
> Markus Duft wrote: |
3 |
> > Hey! |
4 |
> > |
5 |
> > seems i found a problem with chpathtool. i tried to chpath a whole |
6 |
> > prefix at once recursively, but some files make chpathtool crash. i |
7 |
> > attached one of them, could you have a look at it? i debugged the |
8 |
> > problem on my gentoo linux box, but no luck. |
9 |
> > |
10 |
> |
11 |
> trying again, i found something: it's a off-by-on if the file ends with |
12 |
> for example '/', which makes memstr yield a partial match to magic... |
13 |
|
14 |
it's not an off-by-one, what goes wrong here is the case where you match |
15 |
the start of magic at the end of the buffer, and then try to move the |
16 |
entire length of magic, which of course is not there. |
17 |
|
18 |
> i have a patch for this (attached), that seems to fix it (not sure |
19 |
> wether it destroys something else ;)). could you double check, and |
20 |
> apply? Thanks! |
21 |
|
22 |
I solved it a little bit different, but I think the logic eventually is |
23 |
the same. |
24 |
|
25 |
> owh... and: chpathtool only works as long as magic and value are the |
26 |
> same length. it immediatly (after 10 files or so) crashes if value is |
27 |
> less than magic ... |
28 |
|
29 |
Hmmm, it runs happily on a directory here without problems, do you have |
30 |
another testcase perhaps? |
31 |
|
32 |
|
33 |
-- |
34 |
Fabian Groffen |
35 |
Gentoo on a different level |