Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1413)

Unified Diff: ash/virtual_keyboard_controller.cc

Issue 703703004: Fix infinite loop causing iterator to go out of bounds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unittest. Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/virtual_keyboard_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/virtual_keyboard_controller.cc
diff --git a/ash/virtual_keyboard_controller.cc b/ash/virtual_keyboard_controller.cc
index 5c54f46960871a350db5577309109df5a938f7cf..b88b0cfe7dd4c9c15d73ad29fb26fc8a9a085418 100644
--- a/ash/virtual_keyboard_controller.cc
+++ b/ash/virtual_keyboard_controller.cc
@@ -75,8 +75,8 @@ void VirtualKeyboardController::UpdateDevices() {
std::vector<ui::KeyboardDevice> keyboards =
device_data_manager->keyboard_devices();
for (auto iter = keyboards.begin();
- iter != keyboards.end() ||
- (has_internal_keyboard_ && has_external_keyboard_);
+ iter != keyboards.end() &&
+ (!has_internal_keyboard_ || !has_external_keyboard_);
++iter) {
oshima 2014/11/05 01:34:37 how about for (ui::KeyboardDevice* device : keybo
rsadam 2014/11/05 01:42:32 NInja complains if I make it a pointer, other than
ui::InputDeviceType type = (*iter).type;
if (type == ui::InputDeviceType::INPUT_DEVICE_INTERNAL)
« no previous file with comments | « no previous file | ash/virtual_keyboard_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698