[PATCH 0/1] MR4787: winspool: Make driver_9x static in add_printer_driver.
If it's not static, the string goes out of scope and is overwritten with other stack data. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54387 -- https://gitlab.winehq.org/wine/wine/-/merge_requests/4787
From: Alex Henrie <alexhenrie24(a)gmail.com> If it's not static, the string goes out of scope and is overwritten with other stack data. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54387 --- dlls/winspool.drv/info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c index c1c3b8bf629..9461f62dcbe 100644 --- a/dlls/winspool.drv/info.c +++ b/dlls/winspool.drv/info.c @@ -661,7 +661,7 @@ static BOOL add_printer_driver( const WCHAR *name, const WCHAR *ppd_dir ) di3.pEnvironment = (WCHAR *)all_printenv[i]->envname; if (all_printenv[i]->driverversion == 0) { - WCHAR driver_9x[] = L"wineps16.drv"; + static WCHAR driver_9x[] = L"wineps16.drv"; /* We use wineps16.drv as driver for 16 bit */ di3.pDriverPath = driver_9x; di3.pConfigFile = driver_9x; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/4787
Instead of marking this a `static`, could you move it next to `driver_nt`? See !4796 -- https://gitlab.winehq.org/wine/wine/-/merge_requests/4787#note_56870
On Mon Jan 8 08:22:45 2024 +0000, Huw Davies wrote:
Instead of marking this a `static`, could you move it next to `driver_nt`? See !4796 You can take !4796 instead, that would be fine.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/4787#note_56880
On Mon Jan 8 08:22:45 2024 +0000, Alex Henrie wrote:
You can take !4796 instead, that would be fine. This one had a Wine-Bug: tag which I'd like included too.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/4787#note_56885
participants (3)
-
Alex Henrie -
Alex Henrie (@alexhenrie) -
Huw Davies (@huw)