com php-src: Fixed bug #71625 Crash in php7.dll with bad phar filename: ext/phar/phar.c

From: Date: Thu, 18 Feb 2016 18:32:08 +0000
Subject: com php-src: Fixed bug #71625 Crash in php7.dll with bad phar filename: ext/phar/phar.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-91100@lists.php.net to get a copy of this message
Commit: 0445abd547f4d7c4c694e2458d0581033e37398b Author: Anatol Belski <ab@php.net> Thu, 18 Feb 2016 19:32:08 +0100 Parents: f613d89501a815226ecd0b52fe8856261aac69e0 Branches: PHP-5.6 PHP-7.0 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0445abd547f4d7c4c694e2458d0581033e37398b Log: Fixed bug #71625 Crash in php7.dll with bad phar filename Bugs: https://bugs.php.net/71625 Changed paths: M ext/phar/phar.c Diff: diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 0277645..228dfca 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) {

« previous php.cvs (#91100) next »