Bug #18285: Memory Corruption with LANG and Safe Mode
| From: | ilia at prohost dot org | Date: | Thu, 11 Jul 2002 21:09:46 +0000 |
| Subject: | Bug #18285: Memory Corruption with LANG and Safe Mode | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-13882@lists.php.net to get a copy of this message | ||
From: ilia@prohost.org
Operating system: Linux 2.4.17
PHP version: 4.2.1
PHP Bug Type: Scripting Engine problem
Bug description: Memory Corruption with LANG and Safe Mode
While trying to make a directory on a system with safe_mode enabled and
LANG enviroemnt variable fi_FI@euro I came across the problem that is best
demonstrated by the script below:
<?php
$src = '/dir/another/dir2/src';
if( !is_dir($src) ) {
echo "no dir $src<br>n";
if( !@mkdir($src, 0755) ) {
echo "cannot make dir: $src<Br>n";
}
}
?>
On the 2nd echo $src string is corrupted, the last / is replaced with a
special character, which Mozilla displayes as a square.
If mkdir($src, 0755) is replaced with mkdir($src.'', 0755) the memory
corruption goes away.
--
Edit bug report at http://bugs.php.net/?id=18285&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=18285&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=18285&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=18285&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=18285&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=18285&r=support
Expected behavior: http://bugs.php.net/fix.php?id=18285&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=18285&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=18285&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=18285&r=globals