Merge "Fix NULL deref on exec-in with insufficient arguments"

This commit is contained in:
Treehugger Robot 2016-04-22 15:40:58 +00:00 committed by Gerrit Code Review
commit 245e4dbfd4
1 changed files with 5 additions and 0 deletions

View File

@ -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;