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

This commit is contained in:
Zach Riggle 2016-04-18 19:19:33 +00:00 committed by Android (Google) Code Review
commit 94cc368689

View file

@ -1656,6 +1656,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;