From 45bf8c61bd513d6bd49062a1bb8b259d7e2f6279 Mon Sep 17 00:00:00 2001 From: John Brooks Date: Wed, 9 Jan 2013 12:35:48 -0700 Subject: [PATCH] Fix NEMO#598: invoker segfaults when run without --type --- src/invoker/invoker.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/invoker/invoker.c b/src/invoker/invoker.c index a64aaa3..68700fc 100644 --- a/src/invoker/invoker.c +++ b/src/invoker/invoker.c @@ -791,12 +791,18 @@ int main(int argc, char *argv[]) return EXIT_STATUS_APPLICATION_NOT_FOUND; } + if (!app_type) + { + report(report_error, "Application type must be specified with --type.\n"); + usage(1); + } + // Translate 'qt' and 'm' types to 'q' for compatibility if (!strcmp(app_type, "qt") || !strcmp(app_type, "m")) app_type = "q"; // Check if application type is unknown. Only accept one character types. - if (!app_type || !app_type[0] || app_type[1]) + if (!app_type[0] || app_type[1]) { report(report_error, "Application's type is unknown.\n"); usage(1);