Index: wvparse.c =================================================================== RCS file: /cvsroot/wvware/wv/wvparse.c,v retrieving revision 1.13 diff -u -r1.13 wvparse.c --- wvparse.c 1 Dec 2002 11:23:46 -0000 1.13 +++ wvparse.c 11 Oct 2004 07:25:49 -0000 @@ -100,6 +100,28 @@ wvGetFIB (&ps->fib, ps->mainfd); ps->tablefd = wvWhichTableStream (&ps->fib, ps); + // SIS (radusdirect@yahoo.com) + // Check the validity of the table stream. + if (ps->tablefd == NULL) + { + wvOLEFree(ps); + wvError(("Data Stream Corrupt or Not Readable\n")); + return (-1); + } + + // When the data stream is null, it is highly probable + // that the document is corrupt + if (ps->data == NULL) + { + // checking for the validity of the Clx data from the table stream + if (wvStream_goto(ps->tablefd, ps->fib.fcClx)==-1) + { + wvOLEFree(ps); + wvError(("Data Stream Corrupt or Not Readable\n")); + return (-1); + } + wvStream_rewind(ps->tablefd); // Reset the stream to the begining + } // SIS ret = wvQuerySupported (&ps->fib, &reason);