mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fixed bug #72284 (phpdbg fatal errors with coverage)
Cherry-pick of original commits d3371b and 0f20e11
only present in master
This commit is contained in:
parent
933d6b188c
commit
67468fb417
2 changed files with 9 additions and 3 deletions
3
NEWS
3
NEWS
|
@ -17,6 +17,9 @@ PHP NEWS
|
||||||
. Fixed bug #71573 (Segfault (core dumped) if paramno beyond bound).
|
. Fixed bug #71573 (Segfault (core dumped) if paramno beyond bound).
|
||||||
(Laruence)
|
(Laruence)
|
||||||
|
|
||||||
|
- Phpdbg:
|
||||||
|
. Fixed bug #72284 (phpdbg fatal errors with coverage). (Bob)
|
||||||
|
|
||||||
- Postgres:
|
- Postgres:
|
||||||
. Fixed bug #72195 (pg_pconnect/pg_connect cause use-after-free). (Laruence)
|
. Fixed bug #72195 (pg_pconnect/pg_connect cause use-after-free). (Laruence)
|
||||||
. Fixed bug #72197 (pg_lo_create arbitrary read). (Anatol)
|
. Fixed bug #72197 (pg_lo_create arbitrary read). (Anatol)
|
||||||
|
|
|
@ -232,6 +232,7 @@ void phpdbg_list_function_byname(const char *str, size_t len) /* {{{ */
|
||||||
efree(func_name);
|
efree(func_name);
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/* Note: do not free the original file handler, let original compile_file() or caller do that. Caller may rely on its value to check success */
|
||||||
zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) {
|
zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) {
|
||||||
phpdbg_file_source data, *dataptr;
|
phpdbg_file_source data, *dataptr;
|
||||||
zend_file_handle fake;
|
zend_file_handle fake;
|
||||||
|
@ -242,8 +243,7 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) {
|
||||||
char resolved_path_buf[MAXPATHLEN];
|
char resolved_path_buf[MAXPATHLEN];
|
||||||
|
|
||||||
if (zend_stream_fixup(file, &bufptr, &data.len) == FAILURE) {
|
if (zend_stream_fixup(file, &bufptr, &data.len) == FAILURE) {
|
||||||
zend_file_handle_dtor(file);
|
return PHPDBG_G(compile_file)(file, type);
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
data.buf = emalloc(data.len + ZEND_MMAP_AHEAD + 1);
|
data.buf = emalloc(data.len + ZEND_MMAP_AHEAD + 1);
|
||||||
|
@ -280,6 +280,10 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) {
|
||||||
if (ret == NULL) {
|
if (ret == NULL) {
|
||||||
efree(data.buf);
|
efree(data.buf);
|
||||||
efree(dataptr);
|
efree(dataptr);
|
||||||
|
|
||||||
|
fake.opened_path = NULL;
|
||||||
|
zend_file_handle_dtor(&fake);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -289,7 +293,6 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) {
|
||||||
|
|
||||||
fake.opened_path = NULL;
|
fake.opened_path = NULL;
|
||||||
zend_file_handle_dtor(&fake);
|
zend_file_handle_dtor(&fake);
|
||||||
zend_file_handle_dtor(file);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue