ID:               30573
 Updated by:       [EMAIL PROTECTED]
 Reported By:      jbarwick at sentienthealth dot com
-Status:           Assigned
+Status:           Closed
 Bug Type:         Compile Warning
 Operating System: SuSE9.1 (amd64)
 PHP Version:      4.3.8
 Assigned To:      moriyoshi
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:
------------------------------------------------------------------------

[2004-10-27 04:10:16] jbarwick at sentienthealth dot com

Description:
------------
file in consideration:

ext/mbstring/libmbfl/filters/mbfilter_htmlent.c  line 156

The line in question is written as:

filter->cache = (int)mbfl_malloc(html_enc_buffer_size+1);

This line is invalid on 64 bit systems as mbfl_malloc should be
returning a pointer (64 bit) and int is not...

filter->cache is defined as a long ... questions, should it be ulong? 
don't wanna change it cuz I don't know if there is any negative math
used here....

Anyway, if we rewrite the line to:

filter->cache = (long)mbfl_malloc(html_enc_buffer_size+1);

we fix the invalid data type size, and this WILL work on both 32 bit
and 64 bit systems.

Throwing away the top 32 bits of a 64 bit pointer is extremely
dangerous...don't you think?

Reproduce code:
---------------
compile the source

Expected result:
----------------
no compiler warnings

Actual result:
--------------
compiler warnings:
cast from pointer ot integer of different size..


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=30573&edit=1

Reply via email to