php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32047 Wrong format string in zend_mm_alloc
Submitted: 2005-02-21 14:44 UTC Modified: 2005-03-06 16:55 UTC
From: mcihar at suse dot cz Assigned:
Status: Closed Package: Compile Warning
PHP Version: 5.0.3 OS: Linux, 64-bit
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mcihar at suse dot cz
New email:
PHP Version: OS:

 

 [2005-02-21 14:44 UTC] mcihar at suse dot cz
Description:
------------
php-5.0.3/Zend/zend_mm.c: In function `zend_mm_alloc':
php-5.0.3/Zend/zend_mm.c:322: warning: int format, different type arg (arg 3)
php-5.0.3/Zend/zend_mm.c:327: warning: int format, different type arg (arg 3)

fix (won't it be better to attach patches?):

--- Zend/zend_mm.c.orig 2004-03-04 10:18:05.000000000 +0100
+++ Zend/zend_mm.c  2005-02-21 13:12:20.252314257 +0100
@@ -319,12 +319,12 @@
        if (true_size > (heap->block_size - ZEND_MM_ALIGNED_SEGMENT_SIZE - ZEND_MM_ALIGNED_HEADER_SIZE)) {
            /* Make sure we add a memory block which is big enough */
            if (zend_mm_add_memory_block(heap, true_size + ZEND_MM_ALIGNED_SEGMENT_SIZE + ZEND_MM_ALIGNED_HEADER_SIZE)) {
-               zend_error(E_ERROR, "Out of memory: cannot allocate %d bytes!", true_size);
+               zend_error(E_ERROR, "Out of memory: cannot allocate %zd bytes!", true_size);
                return NULL;
            }
        } else {
            if (zend_mm_add_memory_block(heap, heap->block_size)) {
-               zend_error(E_ERROR, "Out of memory: cannot allocate %d bytes!", heap->block_size);
+               zend_error(E_ERROR, "Out of memory: cannot allocate %zd bytes!", heap->block_size);
                return NULL;
            }
        }



Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-06 16:55 UTC] sniper@php.net
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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Sep 07 23:01:27 2024 UTC