cvs: php-src(PHP_5_3) /ext/phar util.c
| From: | Steph Fox | Date: | Sat, 21 Jun 2008 19:15:46 +0000 |
| Subject: | cvs: php-src(PHP_5_3) /ext/phar util.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-50522@lists.php.net to get a copy of this message | ||
sfox Sat Jun 21 19:15:46 2008 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/phar util.c
Log:
- fix for segfault in 5.2 (patch from Greg)
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/util.c?r1=1.55.2.17&r2=1.55.2.18&diff_format=u
Index: php-src/ext/phar/util.c
diff -u php-src/ext/phar/util.c:1.55.2.17 php-src/ext/phar/util.c:1.55.2.18
--- php-src/ext/phar/util.c:1.55.2.17 Sat Jun 21 18:57:53 2008
+++ php-src/ext/phar/util.c Sat Jun 21 19:15:46 2008
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: util.c,v 1.55.2.17 2008/06/21 18:57:53 sfox Exp $ */
+/* $Id: util.c,v 1.55.2.18 2008/06/21 19:15:46 sfox Exp $ */
#include "phar_internal.h"
@@ -324,6 +324,7 @@
int n = 0;
char *fname, *arch, *entry, *ret, *test;
int arch_len, entry_len;
+ phar_archive_data *phar = NULL;
if (!filename) {
return NULL;
@@ -339,24 +340,23 @@
efree(entry);
if (*filename == '.') {
- phar_archive_data **pphar = NULL;
int try_len;
- if (FAILURE == phar_get_archive(pphar, arch, arch_len, NULL, 0, NULL TSRMLS_CC)) {
+ if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL TSRMLS_CC)) {
efree(arch);
goto doit;
}
try_len = filename_len;
test = phar_fix_filepath(estrndup(filename, filename_len), &try_len, 1 TSRMLS_CC);
if (*test == '/') {
- if (zend_hash_exists(&((*pphar)->manifest), test + 1, try_len - 1)) {
+ if (zend_hash_exists(&(phar->manifest), test + 1, try_len - 1)) {
spprintf(&ret, 0, "phar://%s%s", arch, test);
efree(arch);
efree(test);
return ret;
}
} else {
- if (zend_hash_exists(&((*pphar)->manifest), test, try_len)) {
+ if (zend_hash_exists(&(phar)->manifest), test, try_len)) {
spprintf(&ret, 0, "phar://%s/%s", arch, test);
efree(arch);
efree(test);