From 065ba4f500b29f2c17f7ddc9864f0ec84f196c88 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Benoi=CC=82t=20LeBlanc?= Date: Mon, 9 Dec 2013 14:28:32 -0500 Subject: [PATCH] Prevent crash in mac CLI application if command-line is not properly parsed (NULL argv causes segmentation fault when printing usage). --- client/Mac/cli/AppDelegate.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/Mac/cli/AppDelegate.m b/client/Mac/cli/AppDelegate.m index 612205b..144ba08 100644 --- a/client/Mac/cli/AppDelegate.m +++ b/client/Mac/cli/AppDelegate.m @@ -94,7 +94,13 @@ void mac_set_view_size(rdpContext* context, MRDPView* view); } status = freerdp_client_settings_parse_command_line(context->settings, argc, argv); - status = freerdp_client_settings_command_line_status_print(context->settings, status, context->argc, context->argv); + + if (context->argc && context->argv) + status = freerdp_client_settings_command_line_status_print(context->settings, status, context->argc, context->argv); + else + { + freerdp_client_print_command_line_help(argc, argv); + } return status; } -- 2.7.4