X-Git-Url: http://www.wagner.pp.ru/gitweb/?p=oss%2Fcatdoc.git;a=blobdiff_plain;f=src%2Fole.c;fp=src%2Fole.c;h=e131a0dac2140921121edfeda7c65dc14fa3ffca;hp=1e26dd797a190d98712ddce6d5a1927471bfae3c;hb=59325793f5368e5eb82da49328ae9a580c33b8e0;hpb=666a23f1c6f51c09f4aa4ad7e863bf901025a82f 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;