From f43a2be8cdff1f97eab02be8f00f01734ffe8ebb Mon Sep 17 00:00:00 2001 From: Steph Fox Date: Sat, 21 Jun 2008 19:15:46 +0000 Subject: [PATCH] - fix for segfault in 5.2 (patch from Greg) --- ext/phar/util.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/phar/util.c b/ext/phar/util.c index 0259231461..09119f86f0 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -324,6 +324,7 @@ splitted: 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 @@ splitted: 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); -- 2.40.0