diff options
author | Wei Wang <wvw@google.com> | 2016-11-16 12:08:30 -0800 |
---|---|---|
committer | Wei Wang <wvw@google.com> | 2016-11-16 15:46:19 -0800 |
commit | d67a4abc647d5ed7235ff7ee1695b31340e63a1c (patch) | |
tree | e51e4b59dc3524c13a99236c12f3ed70cc45e1b3 /init/builtins.cpp | |
parent | 8b1d526a72c1e6705b03f4b3267ee02fe84ce765 (diff) |
init: fix undefined behavior in ExecuteCommand
ExecuteCommand may change command_ vector which leads undefined behavior
This bug is found when adding logs in ExecuteCommand printing our Command class fields
Bug: 32838381
Test: on emulator
Change-Id: I96468bd2192ca80013871a3a6ac4132149363fff
Diffstat (limited to 'init/builtins.cpp')
-rw-r--r-- | init/builtins.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/init/builtins.cpp b/init/builtins.cpp index ebdc8c993..d10f7198e 100644 --- a/init/builtins.cpp +++ b/init/builtins.cpp @@ -589,9 +589,9 @@ static int do_mount_all(const std::vector<std::string>& args) { for (na = args.size() - 1; na > 1; --na) { if (args[na] == "--early") { - path_arg_end = na; - queue_event = false; - mount_mode = MOUNT_MODE_EARLY; + path_arg_end = na; + queue_event = false; + mount_mode = MOUNT_MODE_EARLY; } else if (args[na] == "--late") { path_arg_end = na; import_rc = false; |