]> granicus.if.org Git - php/commitdiff
- fix for segfault in 5.2 (patch from Greg)
authorSteph Fox <sfox@php.net>
Sat, 21 Jun 2008 19:15:46 +0000 (19:15 +0000)
committerSteph Fox <sfox@php.net>
Sat, 21 Jun 2008 19:15:46 +0000 (19:15 +0000)
ext/phar/util.c

index 025923146196cc9c06c8b91d4a94911af9d3eb07..09119f86f030b31e49c6b33d57d8b078dc50259c 100644 (file)
@@ -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);