mirror of
https://github.com/php/php-src.git
synced 2025-08-18 23:18:56 +02:00
MFB fix segfault
This commit is contained in:
parent
ea74d59d3a
commit
3d953abaf3
2 changed files with 16 additions and 10 deletions
|
@ -1,11 +1,11 @@
|
|||
#!/bin/sh
|
||||
export SCRIPT_NAME=/frontcontroller34.php
|
||||
export PATH_INFO=/start/index.php
|
||||
export SCRIPT_FILENAME=/home/cellog/workspace/php5/ext/phar/tests/frontcontroller34.php
|
||||
export PATH_TRANSLATED=/home/cellog/workspace/php5/ext/phar/tests/frontcontroller34.php
|
||||
export SCRIPT_NAME=/front.phar.php
|
||||
export PATH_INFO=
|
||||
export SCRIPT_FILENAME=/home/cellog/workspace/php5/ext/phar/tests/front.phar.php
|
||||
export PATH_TRANSLATED=/home/cellog/workspace/php5/ext/phar/tests/front.phar.php
|
||||
export REDIRECT_STATUS=1
|
||||
export REQUEST_METHOD=GET
|
||||
export REQUEST_URI=/frontcontroller34.php/start/index.php
|
||||
export REQUEST_URI=/front.phar.php
|
||||
cd /home/cellog/workspace/php5/
|
||||
ddd sapi/cgi/php-cgi &
|
||||
cd /home/cellog/workspace/php5/ext/phar
|
||||
|
|
|
@ -445,7 +445,7 @@ PHP_METHOD(Phar, running)
|
|||
*/
|
||||
PHP_METHOD(Phar, mount)
|
||||
{
|
||||
char *fname, *arch, *entry, *path, *actual;
|
||||
char *fname, *arch = NULL, *entry = NULL, *path, *actual;
|
||||
int fname_len, arch_len, entry_len, path_len, actual_len;
|
||||
phar_archive_data **pphar;
|
||||
|
||||
|
@ -467,7 +467,9 @@ PHP_METHOD(Phar, mount)
|
|||
carry_on2:
|
||||
if (SUCCESS != zend_hash_find(&(PHAR_GLOBALS->phar_fname_map), arch, arch_len, (void **)&pphar)) {
|
||||
zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s is not a phar archive, cannot mount", arch);
|
||||
if (arch) {
|
||||
efree(arch);
|
||||
}
|
||||
return;
|
||||
}
|
||||
carry_on:
|
||||
|
@ -476,13 +478,17 @@ carry_on:
|
|||
if (path && path == entry) {
|
||||
efree(entry);
|
||||
}
|
||||
if (arch) {
|
||||
efree(arch);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (path && path == entry) {
|
||||
if (entry && path && path == entry) {
|
||||
efree(entry);
|
||||
}
|
||||
if (arch) {
|
||||
efree(arch);
|
||||
}
|
||||
return;
|
||||
} else if (SUCCESS == zend_hash_find(&(PHAR_GLOBALS->phar_fname_map), fname, fname_len, (void **)&pphar)) {
|
||||
goto carry_on;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue