From: Christian Hofstaedtler Date: Sun, 24 Feb 2013 14:33:32 +0000 (+0100) Subject: Fix out of bounds memory access with /printer:foo X-Git-Tag: 1.1.0-beta1~43^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=559522e346ab2415e978b89ad17bff4b333d1407;p=platform%2Fupstream%2Ffreerdp.git 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. --- 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);