libextractor

GNU libextractor
Log | Files | Refs | Submodules | README | LICENSE

commit 4be41e396fa201de7a044236ce38c88f854b8e4f
parent 28e77e0ef9ac3719c31cb045feb519ce3d7cbd11
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sun,  2 Apr 2006 04:08:42 +0000

Ronan Melennec writes:

Hello Christian,

This is a quick fix for wordextractor.cc, to avoid false positives
(example below). The fix is to just look at the file magic number.
The test may not be thorough enough -- I don't know
whether non OLE-2 Word files are supposed to be covered here ?



Diffstat:
Msrc/plugins/wordleaker/wordextractor.cc | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/plugins/wordleaker/wordextractor.cc b/src/plugins/wordleaker/wordextractor.cc @@ -321,6 +321,10 @@ extern "C" { if ( (size < 512 + 898) || (filename == NULL) ) return prev; + if (0 != memcmp(data, "\xd0\xcf\x11\xe0\xa1\xb1\x1a\xe1", 8)) + /* look at file magic number to avoid false positives */ + return prev; + POLE::Storage* storage = new POLE::Storage(filename); storage->open();