summaryrefslogtreecommitdiff
path: root/ext/phar
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2016-02-18 19:32:08 +0100
committerAnatol Belski <ab@php.net>2016-02-18 19:32:08 +0100
commit0445abd547f4d7c4c694e2458d0581033e37398b (patch)
tree39d9bb2ce1a4069b6d12cb5afeea21c3d7378571 /ext/phar
parentf613d89501a815226ecd0b52fe8856261aac69e0 (diff)
downloadphp-git-0445abd547f4d7c4c694e2458d0581033e37398b.tar.gz
Fixed bug #71625 Crash in php7.dll with bad phar filename
Diffstat (limited to 'ext/phar')
-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 02776458f3..228dfcaaaf 100644
--- a/ext/phar/phar.c
+++ b/ext/phar/phar.c
@@ -1791,8 +1791,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) {