Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ccafc79d authored by Zach Riggle's avatar Zach Riggle Committed by Elliott Hughes
Browse files

Fix NULL deref on exec-in with insufficient arguments

(cherry-pick of 566a2816.)

Bug: 28152091
Change-Id: Ib59e3bf7f26974aa09d2e6a0e1d9281d7ce25511
parent d61bfb9a
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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;