X-Git-Url: http://www.wagner.pp.ru/gitweb/?p=oss%2Fcatdoc.git;a=blobdiff_plain;f=src%2Fole.c;h=e131a0dac2140921121edfeda7c65dc14fa3ffca;hp=1e26dd797a190d98712ddce6d5a1927471bfae3c;hb=d9cb3fb664ac9f9684eaa76e916c90d1516855bc;hpb=ccf8e1947728585acd2301c9b8e459e6918bfb5f diff --git a/src/ole.c b/src/ole.c index 1e26dd7..e131a0d 100644 --- a/src/ole.c +++ b/src/ole.c @@ -125,7 +125,11 @@ FILE* ole_init(FILE *f, void *buffer, size_t bufSize) { memcpy(tmpBuf,oleBuf+0x4c,MSAT_ORIG_SIZE); mblock=getlong(oleBuf,0x44); msat_size=getlong(oleBuf,0x48); - if (msat_size * sectorSize) + if (msat_size * sectorSize > fileLength) { + free(tmpBuf); + return NULL; + } + /* fprintf(stderr, "msat_size=%ld\n", msat_size); */ i=0;