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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

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: Thu Mar 28 07:01:27 2024 UTC