com php-src: Improved fix for Bug #69441: ext/phar/phar_inter nal.h
| From: | Stanislav Malyshev | Date: | Mon, 27 Jul 2015 00:31:12 +0000 |
| Subject: | com php-src: Improved fix for Bug #69441: ext/phar/phar_inter nal.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-88315@lists.php.net to get a copy of this message | ||
Commit: 7a4584d3f6e1474c5482824990ed619d6c6883c9
Author: Stanislav Malyshev <stas@php.net> Sun, 26 Jul 2015 17:31:12 -0700
Parents: b7fa67742cd8d2b0ca0c0273b157f6ffee9ad6e2
Branches: PHP-5.4
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7a4584d3f6e1474c5482824990ed619d6c6883c9
Log:
Improved fix for Bug #69441
Bugs:
https://bugs.php.net/69441
Changed paths:
M ext/phar/phar_internal.h
Diff:
diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h
index 84282d2..3d8c8e6 100644
--- a/ext/phar/phar_internal.h
+++ b/ext/phar/phar_internal.h
@@ -618,13 +618,16 @@ static inline void phar_set_inode(phar_entry_info *entry TSRMLS_DC) /* {{{ */
{
char tmp[MAXPATHLEN];
int tmp_len;
- size_t len;
+ size_t len1, len2;
tmp_len = MIN(MAXPATHLEN, entry->filename_len + entry->phar->fname_len);
- len = MIN(entry->phar->fname_len, tmp_len);
- memcpy(tmp, entry->phar->fname, len);
- len = MIN(tmp_len - len, entry->filename_len);
- memcpy(tmp + entry->phar->fname_len, entry->filename, len);
+
+ len1 = MIN(entry->phar->fname_len, tmp_len);
+ memcpy(tmp, entry->phar->fname, len1);
+
+ len2 = MIN(tmp_len - len1, entry->filename_len);
+ memcpy(tmp + len1, entry->filename, len2);
+
entry->inode = (unsigned short)zend_get_hash_value(tmp, tmp_len);
}
/* }}} */