mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: Fix GH-14553: Bug in phpdbg8.3 (also 8.1 and 8.2) echo output - trimmed at NULL byte (?)
This commit is contained in:
1
NEWS
1
NEWS
@@ -31,6 +31,7 @@ PHP NEWS
|
||||
- PHPDBG:
|
||||
. Fixed bug GH-14596 (crashes with ASAN and ZEND_RC_DEBUG=1).
|
||||
(David Carlier)
|
||||
. Fixed bug GH-14553 (echo output trimmed at NULL byte). (nielsdos)
|
||||
|
||||
- Shmop:
|
||||
. Fixed bug GH-14537 (shmop Windows 11 crashes the process). (nielsdos)
|
||||
|
||||
@@ -845,7 +845,7 @@ static void php_sapi_phpdbg_register_vars(zval *track_vars_array) /* {{{ */
|
||||
|
||||
static inline size_t php_sapi_phpdbg_ub_write(const char *message, size_t length) /* {{{ */
|
||||
{
|
||||
return phpdbg_script(P_STDOUT, "%.*s", (int) length, message);
|
||||
return phpdbg_process_print(PHPDBG_G(io)[PHPDBG_STDOUT].fd, P_STDOUT, message, (int) length);
|
||||
} /* }}} */
|
||||
|
||||
/* beginning of struct, see main/streams/plain_wrapper.c line 111 */
|
||||
|
||||
@@ -40,7 +40,7 @@ PHPDBG_API int _phpdbg_asprintf(char **buf, const char *format, ...) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int phpdbg_process_print(int fd, int type, const char *msg, int msglen) {
|
||||
int phpdbg_process_print(int fd, int type, const char *msg, int msglen) {
|
||||
char *msgout = NULL;
|
||||
int msgoutlen = FAILURE;
|
||||
|
||||
|
||||
@@ -59,6 +59,8 @@ PHPDBG_API void phpdbg_free_err_buf(void);
|
||||
PHPDBG_API void phpdbg_activate_err_buf(bool active);
|
||||
PHPDBG_API int phpdbg_output_err_buf(const char *strfmt, ...);
|
||||
|
||||
int phpdbg_process_print(int fd, int type, const char *msg, int msglen);
|
||||
|
||||
|
||||
/* {{{ For separation */
|
||||
#define SEPARATE "------------------------------------------------" /* }}} */
|
||||
|
||||
Binary file not shown.
14
sapi/phpdbg/tests/gh14553.phpt
Normal file
14
sapi/phpdbg/tests/gh14553.phpt
Normal file
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
GH-14553 (Bug in phpdbg8.3 (also 8.1 and 8.2) echo output - trimmed at NULL byte (?))
|
||||
--PHPDBG--
|
||||
r
|
||||
q
|
||||
--FILE--
|
||||
<?php
|
||||
echo "hello\0world";
|
||||
?>
|
||||
--EXPECTF--
|
||||
[Successful compilation of %s]
|
||||
prompt> hello%0world
|
||||
[Script ended normally]
|
||||
prompt>
|
||||
Reference in New Issue
Block a user