#37253 [NEW]: arguments in macro 'safe_emalloc'
| From: | bernard dot theis at laposte dot net | Date: | Sun, 30 Apr 2006 23:14:45 +0000 |
| Subject: | #37253 [NEW]: arguments in macro 'safe_emalloc' | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-96407@lists.php.net to get a copy of this message | ||
From: bernard dot theis at laposte dot net
Operating system: all
PHP version: 5.1.2
PHP Bug Type: Unknown/Other Function
Bug description: arguments in macro 'safe_emalloc'
Description:
------------
Hello,
Please, take a look in the arguments used with the maco 'safe_emalloc',
specially, in file 'ext/standard/array.c'
In function PHP_FUNCTION(min):
safe_emalloc(sizeof(zval **), ZEND_NUM_ARGS(), 0)
In function PHP_FUNCTION(max):
safe_emalloc(sizeof(zval **), ZEND_NUM_ARGS(), 0);
The first and the second arg are inversed (fortunately, they are
commutative):
ZEND_API void *_safe_emalloc(size_t nmemb, size_t size, size_t offset ....
);
thanks,
Bernard
Reproduce code:
---------------
zval ***args = (zval ***) safe_emalloc(sizeof(zval **), ZEND_NUM_ARGS(),
0);
zval **min, result;
int i;
Expected result:
----------------
zval ***args = (zval ***) safe_emalloc(ZEND_NUM_ARGS(), sizeof(zval **),
0);
zval **min, result;
int i;
--
Edit bug report at http://bugs.php.net/?id=37253&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37253&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=37253&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37253&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=37253&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=37253&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=37253&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=37253&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=37253&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=37253&r=support
Expected behavior: http://bugs.php.net/fix.php?id=37253&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=37253&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=37253&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=37253&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37253&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=37253&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=37253&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=37253&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=37253&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=37253&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=37253&r=mysqlcfg