#44818 [NEW]: php://memory writeable when opened read only
| From: | davemastergeneral at gmail dot com | Date: | Thu, 24 Apr 2008 12:45:24 +0000 |
| Subject: | #44818 [NEW]: php://memory writeable when opened read only | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-124474@lists.php.net to get a copy of this message | ||
From: davemastergeneral at gmail dot com
Operating system: Linux csl1226 2.6.22-14-generic
PHP version: 5.2CVS-2008-04-24 (snap)
PHP Bug Type: Streams related
Bug description: php://memory writeable when opened read only
Description:
------------
I use php://memory to save resources when unit testing, I found it
possible to write to the stream despite opening it read only. Not sure if
this is the desired behaviour.
Reproduce code:
---------------
<?php
/**
* php://memory bug
*/
$fh = fopen('php://memory', 'r');
var_dump(fwrite($fh, 'dave'));
?>
Expected result:
----------------
int(0)
Actual result:
--------------
int(4)
--
Edit bug report at http://bugs.php.net/?id=44818&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44818&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44818&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44818&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=44818&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=44818&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=44818&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=44818&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=44818&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=44818&r=support
Expected behavior: http://bugs.php.net/fix.php?id=44818&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=44818&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=44818&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=44818&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44818&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=44818&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=44818&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=44818&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=44818&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=44818&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=44818&r=mysqlcfg