Rémi Bernon : winspool.drv: Fix incorrect read of enumerated printer count.

Alexandre Julliard julliard at winehq.org
Mon Nov 15 16:01:27 CST 2021


Module: wine
Branch: master
Commit: ff0f5e40249037c2456e43bf901633097d7ae430
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=ff0f5e40249037c2456e43bf901633097d7ae430

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Sun Nov 14 10:20:26 2021 +0100

winspool.drv: Fix incorrect read of enumerated printer count.

This was changed from a unsigned int to a pointer in
e5d37832ee66d011ba572a9b571e9fb44a7b2b4d and this use was missed,
causing prefix creation hang if the allocated printers array is not
filled with zeros.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 3424c69d196..ac8f0994a1c 100644
--- a/dlls/winspool.drv/info.c
+++ b/dlls/winspool.drv/info.c
@@ -800,7 +800,7 @@ static BOOL init_unix_printers( void )
         if (printer->is_default) default_printer = printer->name;
     }
 
-    if (!default_printer && enum_params.num) default_printer = enum_params.printers[0].name;
+    if (!default_printer && num) default_printer = enum_params.printers[0].name;
     if (default_printer) SetDefaultPrinterW( default_printer );
 
     if (ppd_dir)




More information about the wine-cvs mailing list