diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2003-06-09 18:12:36 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2003-06-09 18:12:36 +0000 |
commit | aec7815e9cc4e29688729b7176ba6457819b6d3b (patch) | |
tree | 7561c123a6dc628a6628ce6b8be80c3c02495315 | |
parent | 7959b2d7b0bbcec820c0d99434cc409c80f4a3eb (diff) | |
download | php-git-aec7815e9cc4e29688729b7176ba6457819b6d3b.tar.gz |
Fixed bug #24098 (Crash in pathinfo() due to double var initialization).
# This is a php5 specific bug, no MFB needed
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | ext/standard/string.c | 1 | ||||
-rw-r--r-- | ext/standard/tests/strings/bug24098.phpt | 15 |
3 files changed, 16 insertions, 1 deletions
@@ -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) diff --git a/ext/standard/string.c b/ext/standard/string.c index ed2e47e299..1141c47ed9 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -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? */ diff --git a/ext/standard/tests/strings/bug24098.phpt b/ext/standard/tests/strings/bug24098.phpt new file mode 100644 index 0000000000..579b41d4b3 --- /dev/null +++ b/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" +} |