]> granicus.if.org Git - php/commitdiff
Fixed bug #24098 (Crash in pathinfo() due to double var initialization).
authorIlia Alshanetsky <iliaa@php.net>
Mon, 9 Jun 2003 18:12:36 +0000 (18:12 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 9 Jun 2003 18:12:36 +0000 (18:12 +0000)
# This is a php5 specific bug, no MFB needed

NEWS
ext/standard/string.c
ext/standard/tests/strings/bug24098.phpt [new file with mode: 0644]

diff --git a/NEWS b/NEWS
index 2ca77547e9d2bd258f778e520321cfa9fc5fe827..b95b4aeb5f9198aa83a8a6b236b7fb5214702040 100644 (file)
--- 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)
index ed2e47e29909d7db6d9c6e8d7d636fa1583939a2..1141c47ed920fa804ce1a1429ba02fc9d98923e5 100644 (file)
@@ -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 (file)
index 0000000..579b41d
--- /dev/null
@@ -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"
+}