[PATCH 0/1] MR1595: gdi32: NULL terminate output string in CreateDCW.
From: Piotr Caban <piotr(a)codeweavers.com> --- dlls/gdi32/dc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c index 6ec11650d27..44dd9b9373d 100644 --- a/dlls/gdi32/dc.c +++ b/dlls/gdi32/dc.c @@ -244,7 +244,7 @@ HDC WINAPI CreateDCW( LPCWSTR driver, LPCWSTR device, LPCWSTR output, { return 0; } - else if (output && !(port = HeapAlloc( GetProcessHeap(), 0, output_str.Length ))) + else if (output && !(port = HeapAlloc( GetProcessHeap(), 0, output_str.Length + sizeof(WCHAR) ))) { ClosePrinter( hspool ); return 0; @@ -271,7 +271,10 @@ HDC WINAPI CreateDCW( LPCWSTR driver, LPCWSTR device, LPCWSTR output, if (ret && hspool && (dc_attr = get_dc_attr( ret ))) { if (port) + { memcpy( port, output, output_str.Length ); + port[output_str.Length / sizeof(WCHAR)] = 0; + } dc_attr->hspool = HandleToULong( hspool ); dc_attr->output = (ULONG_PTR)port; } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/1595
Hi, It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated. The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details: The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=126940 Your paranoid android. === debian11 (32 bit report) === Report validation errors: advapi32:security has no test summary line (early exit of the main process?) advapi32:security has unaccounted for todo messages
This merge request was approved by Huw Davies. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/1595
participants (4)
-
Huw Davies (@huw) -
Marvin -
Piotr Caban -
Piotr Caban (@piotr)