eliminate some warning msgs

git-svn: trunk@3386
remotes/push_mirror/metadata
Tomasz Kojm 18 years ago
parent dfc10927e9
commit 2b304af942
  1. 4
      ChangeLog
  2. 24
      libclamav/autoit.c
  3. 4
      libclamav/cab.c
  4. 4
      libclamav/sis.c
  5. 2
      libclamav/unzip.c

@ -1,3 +1,7 @@
Mon Dec 10 15:50:22 CET 2007 (tk)
---------------------------------
* libclamav: eliminate some warning msgs
Sun Dec 9 11:43:03 EET 2007 (edwin)
------------------------------------
* shared/misc.c: pass mode to open with O_CREAT.

@ -239,12 +239,17 @@ static int ea05(int desc, cli_ctx *ctx, char *tmpd) {
cli_dbgmsg("autoit: bad file size - giving up\n");
return CL_CLEAN;
}
lseek(desc, 16, SEEK_CUR);
if(!UNP.csize) {
cli_dbgmsg("autoit: skipping empty file\n");
continue;
}
cli_dbgmsg("autoit: compressed size: %x\n", UNP.csize);
cli_dbgmsg("autoit: advertised uncompressed size %x\n", cli_readint32((char *)buf+5) ^ 0x45aa);
cli_dbgmsg("autoit: ref chksum: %x\n", cli_readint32((char *)buf+9) ^ 0xc3d2);
lseek(desc, 16, SEEK_CUR);
if(ctx->limits && ctx->limits->maxfilesize && UNP.csize > ctx->limits->maxfilesize) {
cli_dbgmsg("autoit: skipping file due to size limit (%u, max: %lu)\n", UNP.csize, ctx->limits->maxfilesize);
lseek(desc, UNP.csize, SEEK_CUR);
@ -268,7 +273,8 @@ static int ea05(int desc, cli_ctx *ctx, char *tmpd) {
continue;
}
UNP.usize = be32_to_host(*(uint32_t *)(buf+4));
if(!(UNP.usize = be32_to_host(*(uint32_t *)(buf+4))))
UNP.usize = UNP.csize; /* only a specifically crafted or badly corrupted sample should land here */
if(ctx->limits && ctx->limits->maxfilesize && UNP.usize > ctx->limits->maxfilesize) {
cli_dbgmsg("autoit: skipping file due to size limit (%u, max: %lu)\n", UNP.csize, ctx->limits->maxfilesize);
free(buf);
@ -538,12 +544,17 @@ static int ea06(int desc, cli_ctx *ctx, char *tmpd) {
cli_dbgmsg("autoit: bad file size - giving up\n");
return CL_CLEAN;
}
lseek(desc, 16, SEEK_CUR);
if(!UNP.csize) {
cli_dbgmsg("autoit: skipping empty file\n");
continue;
}
cli_dbgmsg("autoit: compressed size: %x\n", UNP.csize);
cli_dbgmsg("autoit: advertised uncompressed size %x\n", cli_readint32((char *)buf+5) ^ 0x87bc);
cli_dbgmsg("autoit: ref chksum: %x\n", cli_readint32((char *)buf+9) ^ 0xa685);
lseek(desc, 16, SEEK_CUR);
if(ctx->limits && ctx->limits->maxfilesize && UNP.csize > ctx->limits->maxfilesize) {
cli_dbgmsg("autoit: skipping file due to size limit (%u, max: %lu)\n", UNP.csize, ctx->limits->maxfilesize);
lseek(desc, UNP.csize, SEEK_CUR);
@ -568,7 +579,8 @@ static int ea06(int desc, cli_ctx *ctx, char *tmpd) {
continue;
}
UNP.usize = be32_to_host(*(uint32_t *)(buf+4));
if(!(UNP.usize = be32_to_host(*(uint32_t *)(buf+4))))
UNP.usize = UNP.csize; /* only a specifically crafted or badly corrupted sample should land here */
if(ctx->limits && ctx->limits->maxfilesize && UNP.usize > ctx->limits->maxfilesize) {
free(buf);
continue;

@ -421,7 +421,7 @@ int cab_open(int fd, off_t offset, struct cab_archive *cab)
if(fidx < 0xfffd) {
if(fidx > cab->nfolders) {
if(bscore < 3)
cli_warnmsg("cab_open: File %s is not associated with any folder\n", file->name);
cli_dbgmsg("cab_open: File %s is not associated with any folder\n", file->name);
bscore++;
free(file->name);
free(file);
@ -465,7 +465,7 @@ static int cab_read_block(int fd, struct cab_state *state, uint16_t resdata)
if(cli_readn(fd, &block_hdr, sizeof(block_hdr)) != sizeof(block_hdr)) {
cli_errmsg("cab_read_block: Can't read block header\n");
cli_dbgmsg("cab_read_block: Can't read block header\n");
return CL_EIO;
}

@ -77,7 +77,7 @@ static char *sis_utf16_decode(const char *str, uint32_t length)
if(!length || length % 2) {
cli_warnmsg("SIS: sis_utf16_decode: Broken filename (length == %d)\n", length);
cli_dbgmsg("SIS: sis_utf16_decode: Broken filename (length == %d)\n", length);
return NULL;
}
@ -294,7 +294,7 @@ static int sis_extract_simple(int fd, char *mfile, uint32_t length, uint32_t off
}
if(uncompress((Bytef *) buff, &osize , (Bytef *) mfile + fileoff, csize) != Z_OK) {
cli_errmsg("SIS: sis_extract_simple: File decompression failed\n");
cli_dbgmsg("SIS: sis_extract_simple: File decompression failed\n");
free(buff);
free(subdir);
free(fname);

@ -246,7 +246,7 @@ static int __zip_parse_root_directory(int fd, struct zip_disk_trailer *trailer,
bfcnt = 0;
if(!hdr->d_compr && hdr->d_csize != hdr->d_usize) {
cli_warnmsg("Unzip: __zip_parse_root_directory: File claims to be stored but csize != usize\n");
cli_dbgmsg("Unzip: __zip_parse_root_directory: File claims to be stored but csize != usize\n");
cli_dbgmsg("Unzip: __zip_parse_root_directory: Also checking for method 'deflated'\n");
hdr->d_bf[bfcnt] = ZIP_METHOD_DEFLATED;
bfcnt++;

Loading…
Cancel
Save