summaryrefslogtreecommitdiff
path: root/ext/phar
diff options
context:
space:
mode:
authorFelipe Pena <felipensp@gmail.com>2012-06-07 14:18:34 -0300
committerFelipe Pena <felipensp@gmail.com>2012-06-07 14:18:34 -0300
commit018a9b321fc1d405dacff7cba4c2623f4ec0fe51 (patch)
tree1a1a5effb0ce98e710797d891f837b58ff0fab90 /ext/phar
parent4e6f27f4db6121e67f17906b27cc829120738b71 (diff)
parent15213768e6cc098ab4e53cacc3b5eb86fa85284a (diff)
downloadphp-git-018a9b321fc1d405dacff7cba4c2623f4ec0fe51.tar.gz
Merge commit '15213768e6cc098ab4e53cacc3b5eb86fa85284a' into PHP-5.3
Diffstat (limited to 'ext/phar')
-rw-r--r--ext/phar/phar.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/phar/phar.c b/ext/phar/phar.c
index d8eaad1a24..f7d08da4ab 100644
--- a/ext/phar/phar.c
+++ b/ext/phar/phar.c
@@ -1799,7 +1799,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
- a = strstr(realpath, fname) + ((ext - fname) + ext_len);
+ if ((a = strstr(realpath, fname)) == NULL) {
+ return FAILURE;
+ }
+
+ a += ((ext - fname) + ext_len);
*a = '\0';
slash = strrchr(realpath, '/');