diff --git a/adb/commandline.cpp b/adb/commandline.cpp index d8b165475..45c6142e5 100644 --- a/adb/commandline.cpp +++ b/adb/commandline.cpp @@ -1613,6 +1613,11 @@ int adb_commandline(int argc, const char **argv) { else if (!strcmp(argv[0], "exec-in") || !strcmp(argv[0], "exec-out")) { int exec_in = !strcmp(argv[0], "exec-in"); + if (argc < 2) { + fprintf(stderr, "Usage: adb %s command\n", argv[0]); + return 1; + } + std::string cmd = "exec:"; cmd += argv[1]; argc -= 2;