Skip to content

Commit

Permalink
Fixed bug #24098 (Crash in pathinfo() due to double var initialization).
Browse files Browse the repository at this point in the history
# This is a php5 specific bug, no MFB needed
  • Loading branch information
Ilia Alshanetsky committed Jun 9, 2003
1 parent 7959b2d commit aec7815
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions NEWS
Expand Up @@ -100,6 +100,7 @@ PHP NEWS

- Fixed is_executable() to be available also on Windows. (Shane)
- Fixed dirname() and strip_tags() to be binary-safe. (Moriyoshi)
- Fixed bug #24098 (crash in pathinfo()). (Ilia)
- Fixed bug #21985 and #22064 (various mb_send_mail() issues). (Moriyoshi)
- Fixed bug #21600 (Assign by reference function call changes variable
contents). (Zeev)
Expand Down
1 change: 0 additions & 1 deletion ext/standard/string.c
Expand Up @@ -1268,7 +1268,6 @@ PHP_FUNCTION(pathinfo)
if ((opt & PHP_PATHINFO_EXTENSION) == PHP_PATHINFO_EXTENSION) {
char *p;
int idx;
int ret_len;
int have_basename = ((opt & PHP_PATHINFO_BASENAME) == PHP_PATHINFO_BASENAME);

/* Have we alrady looked up the basename? */
Expand Down
15 changes: 15 additions & 0 deletions ext/standard/tests/strings/bug24098.phpt
@@ -0,0 +1,15 @@
--TEST--
Bug #24098 (pathinfo() crash)
--FILE--
<?php
var_dump(pathinfo("/dsds.asa"));
?>
--EXPECT--
array(3) {
["dirname"]=>
string(1) "/"
["basename"]=>
string(8) "dsds.asa"
["extension"]=>
string(3) "asa"
}

0 comments on commit aec7815

Please sign in to comment.