commit | 245e4dbfd459f63bad100b09bd58e3931924e16f | [log] [tgz] |
---|---|---|
author | Treehugger Robot <treehugger-gerrit@google.com> | Fri Apr 22 15:40:58 2016 +0000 |
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | Fri Apr 22 15:40:58 2016 +0000 |
tree | de71e565c197cf4930783484b6c029c0faf60527 | |
parent | d61bfb9a79e3e7a85738341a8cbc67abf4e56e8b [diff] | |
parent | ccafc79de7c46c53c33f38a6623f6d2d379d3d58 [diff] |
Merge "Fix NULL deref on exec-in with insufficient arguments"
diff --git a/adb/commandline.cpp b/adb/commandline.cpp index d8b1654..45c6142 100644 --- a/adb/commandline.cpp +++ b/adb/commandline.cpp
@@ -1613,6 +1613,11 @@ 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;