[PATCH] winspool.drv: Stop crash when PortName is NULL
Alistair Leslie-Hughes
leslie_alistair at hotmail.com
Wed Nov 21 21:10:27 CST 2018
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=33502
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
---
dlls/winspool.drv/info.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c
index 7c4ee9a..ea4afec 100644
--- a/dlls/winspool.drv/info.c
+++ b/dlls/winspool.drv/info.c
@@ -1572,7 +1572,8 @@ static void old_printer_check( BOOL delete_phase )
EnumPrintersW( PRINTER_ENUM_LOCAL, NULL, 5, (LPBYTE)pi, needed, &needed, &num );
for (i = 0; i < num; i++)
{
- if (strncmpW( pi[i].pPortName, CUPS_Port, strlenW(CUPS_Port) ) &&
+ if (pi[i].pPortName &&
+ strncmpW( pi[i].pPortName, CUPS_Port, strlenW(CUPS_Port) ) &&
strncmpW( pi[i].pPortName, LPR_Port, strlenW(LPR_Port) ))
continue;
--
1.9.1
More information about the wine-devel
mailing list