From: Ilia Alshanetsky Date: Mon, 9 Jun 2003 18:12:36 +0000 (+0000) Subject: Fixed bug #24098 (Crash in pathinfo() due to double var initialization). X-Git-Tag: RELEASE_1_0_2~337 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aec7815e9cc4e29688729b7176ba6457819b6d3b;p=php Fixed bug #24098 (Crash in pathinfo() due to double var initialization). # This is a php5 specific bug, no MFB needed --- diff --git a/NEWS b/NEWS index 2ca77547e9..b95b4aeb5f 100644 --- a/NEWS +++ b/NEWS @@ -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-- + +--EXPECT-- +array(3) { + ["dirname"]=> + string(1) "/" + ["basename"]=> + string(8) "dsds.asa" + ["extension"]=> + string(3) "asa" +}