mirror of
https://github.com/php/php-src.git
synced 2025-08-19 08:49:28 +02:00
fix invalid variable access
This commit is contained in:
parent
e7a8df1248
commit
023d1c96ea
1 changed files with 10 additions and 3 deletions
|
@ -746,6 +746,13 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, char *url_from, char
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (SUCCESS != phar_get_archive(&pfrom, resource_from->host, strlen(resource_from->host), NULL, 0, &error TSRMLS_CC)) {
|
||||
pfrom = NULL;
|
||||
if (error) {
|
||||
efree(error);
|
||||
}
|
||||
}
|
||||
if (PHAR_G(readonly) && (!pfrom || !pfrom->is_data)) {
|
||||
php_url_free(resource_from);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "phar error: write operations disabled by phar.readonly INI setting");
|
||||
|
@ -764,10 +771,10 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, char *url_from, char
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (SUCCESS != phar_get_archive(&pfrom, resource_from->host, strlen(resource_from->host), NULL, 0, &error TSRMLS_CC)) {
|
||||
pfrom = NULL;
|
||||
}
|
||||
if (SUCCESS != phar_get_archive(&pto, resource_to->host, strlen(resource_to->host), NULL, 0, &error TSRMLS_CC)) {
|
||||
if (error) {
|
||||
efree(error);
|
||||
}
|
||||
pto = NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue