Commit:    15213768e6cc098ab4e53cacc3b5eb86fa85284a
Author:    Felipe Pena <felipe...@gmail.com>         Mon, 4 Jun 2012 20:07:14 
-0300
Parents:   167e2fd78224887144496cdec2089cd5b2f3312d
Branches:  PHP-5.3 PHP-5.4 master

Link:       
http://git.php.net/?p=php-src.git;a=commitdiff;h=15213768e6cc098ab4e53cacc3b5eb86fa85284a

Log:
- Fixed bug #62227 (Invalid phar stream path causes crash)

Bugs:
https://bugs.php.net/62227

Changed paths:
  M  ext/phar/phar.c


Diff:
diff --git a/ext/phar/phar.c b/ext/phar/phar.c
index 4ab2b86..8a0ebfa 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, '/');


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to