Index: libole2/ms-ole.c =================================================================== RCS file: /cvsroot/wvware/wv/libole2/ms-ole.c,v retrieving revision 1.26 diff -u -r1.26 ms-ole.c --- libole2/ms-ole.c 30 Mar 2003 17:02:42 -0000 1.26 +++ libole2/ms-ole.c 22 Oct 2004 06:18:24 -0000 @@ -1152,7 +1152,11 @@ f->pps = g_list_append (0, pps); } - if (PPS_GET_NEXT(mem) != PPS_END_OF_CHAIN) + // SIS (radusdirect@yahoo.com) + // I have added another condition to the recursive parsing + // If PPS_GET_NEXT(mem) return 0 (ROOT), there is possibility of heavy recursion. + // I have disabled this recursion by adding an input condition + if (PPS_GET_NEXT(mem) && (PPS_GET_NEXT(mem) != PPS_END_OF_CHAIN)) pps_decode_tree (f, PPS_GET_NEXT(mem), parent); if (PPS_GET_PREV(mem) != PPS_END_OF_CHAIN) @@ -1202,6 +1206,13 @@ last = blk; blk = NEXT_BB (f, blk); g_array_index (f->bb, BLP, last) = UNUSED_BLOCK; + + if (blk >= f->bb->len) // radusdirect@yahoo.com 22.Oct.2004 + { // Added boundary condition to the block + g_warning ("Corrupt block file: " // chain traversal. + "invalid block in chain\n"); + break; + } } }