diff --git a/src/wayland/weston-launch.c b/src/wayland/weston-launch.c index 71c753093..e848d845a 100644 --- a/src/wayland/weston-launch.c +++ b/src/wayland/weston-launch.c @@ -737,6 +737,8 @@ main(int argc, char *argv[]) if ((argc - optind) > (MAX_ARGV_SIZE - 6)) error(1, E2BIG, "Too many arguments to pass to weston"); + if (optind >= argc) + error(1, 0, "Expected program argument"); if (strcmp (argv[optind], "mutter-wayland") && strcmp (argv[optind], "gnome-shell-wayland")) error(1, 0, "mutter-launch can only be used to launch mutter or gnome-shell");