Andrew C - 2002-04-25

I have found a bug in wv-0.7.1, actually
specifically in the libole2 library. The
problem occurs when no mmap facility is
available, which was the case with my
Cygwin installation.

The symptom is that files read cannot
be recognized. The bug is that the reading
of the file does not specify the correct
number of bytes to be read.

The bug is in the libole2/ms-ole.c file;
in the version that ships with wv-0.7.1
it is on line 1717:

if (!f->mem ||
    f->syswrap->read (file, f->mem, (BB_BLOCK_SIZE == -1),
              f->syswrap->closure)) {

it should read

if (!f->mem ||
    (f->syswrap->read (file, f->mem,
    BB_BLOCK_SIZE, f->syswrap->closure) == -1)) {

This bug was not in wv-0.7.0, and was introduced
when the new libole2 sources were integrated.

The bug is still in the latest version of the
libole2 library that I checked (libole2-0.2.4)
but I'm not sure who to inform.

There seems to be another bug with reading
big files as well, if mmap is not available.
If anyone can help with that it would be
appreciated.

Andrew