-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

the attached patch fixes some warning I get while compiling clamav on win32
patches for libclamav/unrar/unrarvm.c are trivial (only casts before 
cli_malloc/realloc)
I'm not sure about the cast I made in libclamav/unrar/unrarppm.c

ppm_data->sub_alloc.ptext is uint8_t *
ppm_data->min_context->con_ut.u.stats is struct state_tag *

they are pointer and the it should be ok, but it's intentional?
I mean like ppm_data->sub_alloc.ptext is a generic data buffer
and the >= and > is referred to the masked struct over uint8_t * pointer?

Btw Should I post bug/patches to bugzilla instead of this ml?

Regards

- --
Gianluigi Tiesi <[EMAIL PROTECTED]>
EDP Project Leader
Netfarm S.r.l. - http://www.netfarm.it/
Free Software: http://oss.netfarm.it/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFGhJu3UE5cRfnO04RAmrJAKC6KOwMq5rzxHT01KXcct1yA2BA1ACfcesQ
gNSQ5eqQqVMZ+TYiqD0EBfU=
=aaj1
-----END PGP SIGNATURE-----
Index: libclamav/unrar/unrarppm.c
===================================================================
--- libclamav/unrar/unrarppm.c  (revision 682)
+++ libclamav/unrar/unrarppm.c  (working copy)
@@ -977,8 +977,8 @@
                return -1;
        }
        if (ppm_data->min_context->num_stats != 1) {
-               if (ppm_data->min_context->con_ut.u.stats <= 
ppm_data->sub_alloc.ptext ||
-                       ppm_data->min_context->con_ut.u.stats > 
ppm_data->sub_alloc.heap_end) {
+               if (ppm_data->min_context->con_ut.u.stats <= (struct state_tag 
*) ppm_data->sub_alloc.ptext ||
+                       ppm_data->min_context->con_ut.u.stats > (struct 
state_tag *) ppm_data->sub_alloc.heap_end) {
                        return -1;
                }
                if (!ppm_decode_symbol1(ppm_data, ppm_data->min_context)) {
Index: libclamav/unrar/unrarvm.c
===================================================================
--- libclamav/unrar/unrarvm.c   (revision 682)
+++ libclamav/unrar/unrarvm.c   (working copy)
@@ -927,7 +927,7 @@
                (unsigned int 
*)&rarvm_data->mem[VM_GLOBALMEMADDR+0x30]),VM_GLOBALMEMSIZE);
        if (data_size != 0) {
                prg->global_size += data_size+VM_FIXEDGLOBALSIZE;
-               prg->global_data = cli_realloc(prg->global_data, 
prg->global_size);
+               prg->global_data = (unsigned char *) 
cli_realloc(prg->global_data, prg->global_size);
                if(!prg->global_data) {
                    cli_dbgmsg("unrar: rarvm_execute: cli_realloc failed for 
prg->global_data\n");
                    return FALSE;
@@ -1077,14 +1077,14 @@
                if (data_flag & 0x8000) {
                        int data_size = rarvm_read_data(rarvm_input)+1;
                        rar_dbgmsg("data_size=%d\n", data_size);
-                       prg->static_data = cli_malloc(data_size);
+                       prg->static_data = (unsigned char *) 
cli_malloc(data_size);
                        if(!prg->static_data) {
                            cli_dbgmsg("unrar: rarvm_prepare: cli_malloc failed 
for prg->static_data\n");
                            return FALSE;
                        }
                        for (i=0 ; rarvm_input->in_addr < code_size && i < 
data_size ; i++) {
                                prg->static_size++;
-                               prg->static_data = 
cli_realloc(prg->static_data, prg->static_size);
+                               prg->static_data = (unsigned char *) 
cli_realloc(prg->static_data, prg->static_size);
                                if(!prg->static_data) {
                                    cli_dbgmsg("unrar: rarvm_prepare: 
cli_realloc failed for prg->static_data\n");
                                    return FALSE;
_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html

Reply via email to