VBA alignment check. Should now work with

all MacOffice documents.


git-svn: trunk@406
This commit is contained in:
Trog 2004-03-17 11:45:15 +00:00
parent 31c42eb7ea
commit cee86c13d7
2 changed files with 15 additions and 5 deletions

View file

@ -1,3 +1,8 @@
Wed Mar 17 11:53:05 GMT 2004 (trog)
-----------------------------------
* libclamav/vba_extract.c: VBA alignment check. Should now work with
all MacOffice documents.
Wed Mar 17 09:32:45 GMT 2004 (trog) Wed Mar 17 09:32:45 GMT 2004 (trog)
----------------------------------- -----------------------------------
* libclamav/vba_extract.c: Add support for MacOffice98 documents * libclamav/vba_extract.c: Add support for MacOffice98 documents

View file

@ -297,11 +297,6 @@ vba_project_t *vba56_dir_read(const char *dir)
cli_dbgmsg("VBA Project: %s, VBA Version=%d\n", vba_version[i].name, cli_dbgmsg("VBA Project: %s, VBA Version=%d\n", vba_version[i].name,
vba_version[i].vba_version); vba_version[i].vba_version);
if (i == 9) {
cli_dbgmsg("MacOffice2001 not currently supported\n");
close(fd);
return NULL;
}
is_mac = vba_version[i].is_mac; is_mac = vba_version[i].is_mac;
/*****************************************/ /*****************************************/
@ -498,6 +493,16 @@ vba_project_t *vba56_dir_read(const char *dir)
} }
} while(ooff != 0xFFFF); } while(ooff != 0xFFFF);
/* check for alignment error */
lseek(fd, -3, SEEK_CUR);
if (vba_readn(fd, &ooff, 2) != 2) {
close(fd);
return NULL;
}
if (ooff != 0xFFFF) {
lseek(fd, 1, SEEK_CUR);
}
if (vba_readn(fd, &ooff, 2) != 2) { if (vba_readn(fd, &ooff, 2) != 2) {
close(fd); close(fd);
return NULL; return NULL;