diff options
author | Colin Walters <walters@verbum.org> | 2013-08-30 08:26:31 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2013-08-30 08:26:31 -0400 |
commit | 7bd4e6ecb0a902ec38abc776e857a5559d636d56 (patch) | |
tree | e6391b790068e0a26e34f69cac8b14f9f313fb10 | |
parent | deeb1db1ac7f72a6056bffb868d8b336ef50c91b (diff) | |
download | mutter-7bd4e6ecb0a902ec38abc776e857a5559d636d56.tar.gz |
weston-launch: Don't segfault if passed no arguments
Probably not exploitable since I think Linux always puts NULL there,
but let's actually check.
-rw-r--r-- | src/wayland/weston-launch.c | 2 |
1 files changed, 2 insertions, 0 deletions
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"); |