minor code cleanup and bug fix

git-svn: trunk@382
remotes/push_mirror/metadata
Trog 22 years ago
parent c5e7d5cd1e
commit 25ba8c63d2
  1. 3
      clamav-devel/ChangeLog
  2. 16
      clamav-devel/libclamav/ole2_extract.c
  3. 25
      clamav-devel/libclamav/vba_extract.c

@ -1,3 +1,6 @@
Mon Mar 8 12:37:26 GMT 2004 (trog)
-----------------------------------
* libclamav: vba_extract.c/ole2_extract.c: minor code cleanup and bug fix
Mon Mar 8 10:01:01 GMT 2004 (trog)
-----------------------------------
* clamd: wrap select()/poll()

@ -97,7 +97,7 @@ typedef struct ole2_header_tag
/* must take account of the size of variables below here when
reading the header */
int32_t sbat_root_start;
} ole2_header_t __attribute__ ((packed));
} __attribute__ ((packed)) ole2_header_t;
typedef struct property_tag
{
@ -110,7 +110,7 @@ typedef struct property_tag
int32_t child;
unsigned char clsid[16];
uint16_t user_flags;
uint32_t user_flags;
uint32_t create_lowdate;
uint32_t create_highdate;
@ -119,7 +119,7 @@ typedef struct property_tag
int32_t start_block;
int32_t size;
unsigned char reserved[4];
} property_t __attribute__ ((packed));
} __attribute__ ((packed)) property_t;
#ifdef HAVE_PRAGMA_PACK
#pragma pack()
@ -135,10 +135,10 @@ int readn(int fd, void *buff, unsigned int count)
{
int retval;
unsigned int todo;
void *current;
unsigned char *current;
todo = count;
current = buff;
current = (unsigned char *) buff;
do {
retval = read(fd, current, todo);
@ -162,10 +162,10 @@ int writen(int fd, void *buff, unsigned int count)
{
int retval;
unsigned int todo;
void *current;
unsigned char *current;
todo = count;
current = buff;
current = (unsigned char *) buff;
do {
retval = write(fd, current, todo);
@ -455,7 +455,7 @@ void ole2_read_property_tree(int fd, ole2_header_t *hdr, const char *dir,
prop_block[index].prev = ole2_endian_convert_32(prop_block[index].prev);
prop_block[index].next = ole2_endian_convert_32(prop_block[index].next);
prop_block[index].child = ole2_endian_convert_32(prop_block[index].child);
prop_block[index].user_flags = ole2_endian_convert_16(prop_block[index].user_flags);
prop_block[index].user_flags = ole2_endian_convert_32(prop_block[index].user_flags);
prop_block[index].create_lowdate = ole2_endian_convert_32(prop_block[index].create_lowdate);
prop_block[index].create_highdate = ole2_endian_convert_32(prop_block[index].create_highdate);
prop_block[index].mod_lowdate = ole2_endian_convert_32(prop_block[index].mod_lowdate);

@ -100,10 +100,10 @@ int vba_readn(int fd, void *buff, unsigned int count)
{
int retval;
unsigned int todo;
void *current;
unsigned char *current;
todo = count;
current = buff;
current = (unsigned char *) buff;
do {
retval = read(fd, current, todo);
@ -127,11 +127,11 @@ int vba_writen(int fd, void *buff, unsigned int count)
{
int retval;
unsigned int todo;
void *current;
unsigned char *current;
todo = count;
current = buff;
current = (unsigned char *) buff;
do {
retval = write(fd, current, todo);
if (retval < 0) {
@ -140,7 +140,7 @@ int vba_writen(int fd, void *buff, unsigned int count)
todo -= retval;
current += retval;
} while (todo > 0);
return count;
}
@ -148,11 +148,11 @@ char *get_unicode_name(char *name, int size)
{
int i, j;
char *newname;
if (*name == 0 || size == 0) {
if (*name == 0 || size == 0) {
return NULL;
}
newname = (char *) cli_malloc(size*2);
if (!newname) {
return NULL;
@ -185,7 +185,7 @@ static void vba56_test_middle(int fd)
if (vba_readn(fd, &test_middle, 20) != 20) {
return;
}
if (memcmp(test_middle, middle_str, 20) != 0) {
lseek(fd, -20, SEEK_CUR);
}
@ -205,7 +205,7 @@ static void vba56_test_end(int fd)
if (vba_readn(fd, &test_end, 20) != 20) {
return;
}
if (memcmp(test_end, end_str, 20) != 0) {
lseek(fd, -20, SEEK_CUR);
}
@ -238,7 +238,6 @@ vba_project_t *vba56_dir_read(const char *dir)
unsigned char fixed_octet[8] = { 0x06, 0x02, 0x01, 0x00, 0x08, 0x02, 0x00, 0x00 };
cli_dbgmsg("in vba56_dir_read()\n");
fullname = (char *) cli_malloc(strlen(dir) + 15);

Loading…
Cancel
Save