From: chenjiangyi chenjiangyi@uniontech.com
Description: The printing function (non-Windows application call) used by Wine developers is unnecessary to abort process when the string is super long. For example, the developer prints a long commandline of wwmapp.exe by MESSAGE. As a result, the process cannot be started, and the conference function cannot be used.
Signed-off-by: chenjiangyi chenjiangyi@uniontech.com Change-Id: If06f0309f9745777f89b07dff8d302cb34b2a90e --- dlls/ntdll/unix/debug.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/dlls/ntdll/unix/debug.c b/dlls/ntdll/unix/debug.c index e73ee05fc03..26d1f7a76f7 100644 --- a/dlls/ntdll/unix/debug.c +++ b/dlls/ntdll/unix/debug.c @@ -81,12 +81,15 @@ static int append_output( struct debug_info *info, const char *str, size_t len ) { if (len >= sizeof(info->output) - info->out_pos) { - fprintf( stderr, "wine_dbg_output: debugstr buffer overflow (contents: '%s')\n", info->output ); - info->out_pos = 0; - abort(); + fprintf( stderr, "wine_dbg_output: string to be output exceeds the debugstr buffer and to be truncated !!!\n"); + len = sizeof(info->output) - info->out_pos - 1; + info->output[sizeof(info->output) - 1] = 0; + } + if(len) + { + memcpy( info->output + info->out_pos, str, len ); + info->out_pos += len; } - memcpy( info->output + info->out_pos, str, len ); - info->out_pos += len; return len; }