>   64 65 66 67 68 69 6a 6b
>   6c 6d 6e 6f 70 71 72 73
>   74 75 76 6b 00 00 00 00
>   20 00 00 cd 22 80 01 b8

tailmagic corrupted?

we got:
defghijklmnopqrstuv | k\0\0\0\0 \0\0\cd\22\80\01\b8

we expect:
1234567890abcdefghijklmnopqrstuv | xyz

OverflowCheck is 32 bytes, so xyz are not included in the buffer.

i dont think that the zmagic got corrupted.

cinap
--- Begin Message ---
> found it!
> 
> that is "defghijklmnopqrstuv..." instead of the expected "1234567890abc..."
> 
> 13 bytes!
> 
> b->data is incremented (and b->len decremented)13 bytes to skip the 
> "venti config" magic in readifile() ifile.c:39.
> and freezblock() alculates the position of the zmagic by b->data + b->_size.
> 
> maybe add a b->_data in ZBuffer or fix ifile.c?
> 
> cinap

this might not fix everything as the tail magic was corrupted, too.

- erik


n/sources/plan9//sys/src/cmd/venti/srv/ifile.c:36,43 - ifile.c:36,44
                        freepart(p);
                        return -1;
                }
-               b->data += m;
-               b->len -= m;
+               memmove(b->data, b->data+m, 8192-m);
+               memset(b->data+8192-m, 0, 8192-m);
+ 
                z = memchr(b->data, 0, b->len);
                if(z)
                        b->len = z - b->data;

--- End Message ---

Reply via email to