#26878 [NEW]: *printf argument swapping
| From: | drm at melp dot nl | Date: | Mon, 12 Jan 2004 12:42:29 +0000 |
| Subject: | #26878 [NEW]: *printf argument swapping | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-53178@lists.php.net to get a copy of this message | ||
From: drm at melp dot nl
Operating system: irrelevant
PHP version: 4.3.4
PHP Bug Type: Unknown/Other Function
Bug description: *printf argument swapping
Description:
------------
The *printf family has a bug when pointing to the same argument with
different types. Probably the same memoryaddress is used for casting when
formatting the argument.
Reproduce code:
---------------
printf (
'Int: %1$d and as string: %1$s',
'some string'
);
// Note that the same happens when
// using any of the other printf
// functions
Expected result:
----------------
Int: 0 and as string: some string
Actual result:
--------------
Int: 0 and as string: 0
--
Edit bug report at http://bugs.php.net/?id=26878&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26878&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26878&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=26878&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=26878&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=26878&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=26878&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=26878&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=26878&r=support
Expected behavior: http://bugs.php.net/fix.php?id=26878&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=26878&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=26878&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=26878&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26878&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=26878&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=26878&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=26878&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26878&r=float