From 559522e346ab2415e978b89ad17bff4b333d1407 Mon Sep 17 00:00:00 2001 From: Christian Hofstaedtler Date: Sun, 24 Feb 2013 15:33:32 +0100 Subject: [PATCH] Fix out of bounds memory access with /printer:foo Printer redirection command line parser was checking the wrong way if a printer driver name was specified, causing the to segfault if no driver name was given. --- client/common/cmdline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/common/cmdline.c b/client/common/cmdline.c index 8ea5723..e0784b9 100644 --- a/client/common/cmdline.c +++ b/client/common/cmdline.c @@ -290,7 +290,7 @@ int freerdp_client_add_device_channel(rdpSettings* settings, int count, char** p printer->Type = RDPDR_DTYP_PRINT; printer->Name = _strdup(params[1]); - if (params[2]) + if (count > 2) printer->DriverName = _strdup(params[2]); freerdp_device_collection_add(settings, (RDPDR_DEVICE*) printer); -- 2.7.4