com php-src: Add test for bug #66960: ext/phar/tests/bug66960.phpt
| From: | Nikita Popov | Date: | Mon, 15 Jan 2018 11:20:10 +0000 |
| Subject: | com php-src: Add test for bug #66960: ext/phar/tests/bug66960.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-100884@lists.php.net to get a copy of this message | ||
Commit: cb7387275f1ff3c0616f6819cbfb7ebe5fa5d407
Author: Bishop Bettini <bishop.bettini@gmail.com> Sun, 7 Jan 2018 20:58:02 -0500
Committer: Nikita Popov <nikita.ppv@gmail.com> Mon, 15 Jan 2018 12:20:10 +0100
Parents: 3eaab046637ba6c76b1ef76623820429f1ac36b1
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cb7387275f1ff3c0616f6819cbfb7ebe5fa5d407
Log:
Add test for bug #66960
Bugs:
https://bugs.php.net/66960
Changed paths:
A ext/phar/tests/bug66960.phpt
Diff:
diff --git a/ext/phar/tests/bug66960.phpt b/ext/phar/tests/bug66960.phpt
new file mode 100644
index 0000000..0d2ffa6
--- /dev/null
+++ b/ext/phar/tests/bug66960.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Bug #66960 phar long filename crash
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--INI--
+phar..readonly = 0
+memory_limit = -1
+--FILE--
+<?php
+$file = __DIR__ . DIRECTORY_SEPARATOR . 'bug66960.phar';
+$phar = new Phar($file);
+var_dump(file_exists("phar://$file/". str_repeat('a', PHP_MAXPATHLEN-1)));
+var_dump(file_exists("phar://$file/". str_repeat('a', PHP_MAXPATHLEN)));
+var_dump(file_exists("phar://$file/". str_repeat('a', PHP_MAXPATHLEN+1)));
+echo 'done';
+?>
+--CLEAN--
+$file = __DIR__ . DIRECTORY_SEPARATOR . 'bug66960.phar';
+unlink($file);
+--EXPECT--
+bool(false)
+bool(false)
+bool(false)
+done