summaryrefslogtreecommitdiff
path: root/ext/phar/phar.c
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2016-02-18 19:34:22 +0100
committerAnatol Belski <ab@php.net>2016-02-18 19:34:22 +0100
commit04260664bda7b08c7e9bcba74b2bd4dd30d0ce8f (patch)
tree244c58adee3b9b64bd69cb1ac5be9b96f008c6f0 /ext/phar/phar.c
parent0ce5920aa97d5387732268a6d6895b5f01829d09 (diff)
parent9a5797976a6f4e4617080f8800382bce604a89b5 (diff)
downloadphp-git-04260664bda7b08c7e9bcba74b2bd4dd30d0ce8f.tar.gz
Merge branch 'PHP-7.0'
* PHP-7.0: Fixed bug #71625 Crash in php7.dll with bad phar filename
Diffstat (limited to 'ext/phar/phar.c')
-rw-r--r--ext/phar/phar.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/phar/phar.c b/ext/phar/phar.c
index 54aa02bee6..71498b6a13 100644
--- a/ext/phar/phar.c
+++ b/ext/phar/phar.c
@@ -1784,8 +1784,11 @@ static int phar_analyze_path(const char *fname, const char *ext, int ext_len, in
#ifdef PHP_WIN32
phar_unixify_path_separators(realpath, strlen(realpath));
#endif
- slash = strstr(realpath, filename) + ((ext - fname) + ext_len);
- *slash = '\0';
+ slash = strstr(realpath, filename);
+ if (slash) {
+ slash += ((ext - fname) + ext_len);
+ *slash = '\0';
+ }
slash = strrchr(realpath, '/');
if (slash) {